HDU1409 Is It a Number
http://acm.hdu.edu.cn/showproblem.php?pid=1409
没啥好说的,至今也不知道到底错在哪里了,看了discuss才过的
#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <vector>
#include <string.h>
#include <map>
using namespace std;
char s[];
int solve(char *s){
int i=;
int len=strlen(s);
while(s[i]>=''&&s[i]<=''){
i++;
} if(i==len){
return ;
}
if(s[i]=='.'){
i++;
while(s[i]>=''&&s[i]<=''){
i++;
}
if(i==len){
return ;
}
if(s[i]=='E'){
i++;
if(s[i]=='+'||s[i]=='-'){
i++;
}
if(i==len){
return ;
}
while(s[i]>=''&&s[i]<=''){
i++;
}
if(i==len){
return ;
}
return ;
}
}else if(s[i]=='E'){
if(i==){
return ;
}
i++;
if(s[i]=='+'||s[i]=='-'){
i++;
}
if(i==len){
return ;
}
while(s[i]>=''&&s[i]<=''){
i++;
}
if(i==len){
return ;
}
return ;
}
return ;
}
int t;
int main(){
scanf("%d",&t);
getchar();
while(t--){
gets(s);
if(solve(s)){
cout<<"YES"<<endl;
}else{
cout<<"NO"<<endl;
}
}
return ;
}
HDU1409 Is It a Number的更多相关文章
- JavaScript Math和Number对象
目录 1. Math 对象:数学对象,提供对数据的数学计算.如:获取绝对值.向上取整等.无构造函数,无法被初始化,只提供静态属性和方法. 2. Number 对象 :Js中提供数字的对象.包含整数.浮 ...
- Harmonic Number(调和级数+欧拉常数)
题意:求f(n)=1/1+1/2+1/3+1/4-1/n (1 ≤ n ≤ 108).,精确到10-8 (原题在文末) 知识点: 调和级数(即f(n))至今没有一个完全正确的公式, ...
- Java 特定规则排序-LeetCode 179 Largest Number
Given a list of non negative integers, arrange them such that they form the largest number. For exam ...
- Eclipse "Unable to install breakpoint due to missing line number attributes..."
Eclipse 无法找到 该 断点,原因是编译时,字节码改变了,导致eclipse无法读取对应的行了 1.ANT编译的class Eclipse不认,因为eclipse也会编译class.怎么让它们统 ...
- 移除HTML5 input在type="number"时的上下小箭头
/*移除HTML5 input在type="number"时的上下小箭头*/ input::-webkit-outer-spin-button, input::-webkit-in ...
- iOS---The maximum number of apps for free development profiles has been reached.
真机调试免费App ID出现的问题The maximum number of apps for free development profiles has been reached.免费应用程序调试最 ...
- 有理数的稠密性(The rational points are dense on the number axis.)
每一个实数都能用有理数去逼近到任意精确的程度,这就是有理数的稠密性.The rational points are dense on the number axis.
- [LeetCode] Minimum Number of Arrows to Burst Balloons 最少数量的箭引爆气球
There are a number of spherical balloons spread in two-dimensional space. For each balloon, provided ...
- [LeetCode] Number of Boomerangs 回旋镖的数量
Given n points in the plane that are all pairwise distinct, a "boomerang" is a tuple of po ...
随机推荐
- 英语影视台词---无敌破坏王2大脑互联网(3)((Ralph)我们去喝根汁汽水吧)
英语影视台词---无敌破坏王2大脑互联网(3)((Ralph)我们去喝根汁汽水吧) 一.总结 一句话总结: Let's go get a root beer. 1.(Ralph)让我来瞧瞧你的本事 ...
- java异常的原理以及应用
父类Throwable 两个分支: error:合理的应用程序不应该出现的严重问题,可以无需声明便抛出,比如内存溢出. Exception:程序还能够克服和恢复的问题. 其中又分为系统异常和普通异常. ...
- Collaborative Index Embedding for Image Retrieval
最近看了一篇比较好的文章,效果很好,简单记录一下. 这篇文章的核心思想是,融合两种不同类型的特征.文章中用的是SIFT和CNN提取的特征.还是神经大法好啊. 第一步就是建立两种不同特征的索引,文章用的 ...
- iOS UINavgationController、 UINavigationBar、 UINavigationItem关系分析
一般导航控制器含有4个对象,UINavigationController.UINavigationBar.UIViewController.UINavigationItem. 1:UINavigati ...
- C++正确的cin输入
void test1(void) { int number; cout << ">> pls input a integer number:"; while ...
- shell 统计词频脚本
#!/bin/bash if [ $# -ne 1 ]; then echo "Usage:$0 filename"; exit -1 fi filename=$1 egrep - ...
- IOS技能要求
iOS专业技能: 拥有独立开发iOS APP应用的能力,并且独立开发过多款应用:熟练掌握iOS主流界面布局设计,基本控件和自定义控件的使用,事件处理及事件分发机制:熟练掌握工厂.代理.观察者.单例等多 ...
- maven工程导入eclipse后报错
原因:需要重新部署下tomcat环境 解决方式: 右击->属性:
- python3.5 使用tkinter 和requests库实现天气图像化显示
1 """ 该python小例子考察使用了tkinter库,requests库 其中: requests库用来发送网络请求 thkinter用来显示图形化界面 请求的天气 ...
- (I/O完成端口中的)995错误
在windows下,可能会出现995的错误,msdn对该错误的解释为: The I/O operation has been aborted because of either a thread ex ...