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的更多相关文章

  1. JavaScript Math和Number对象

    目录 1. Math 对象:数学对象,提供对数据的数学计算.如:获取绝对值.向上取整等.无构造函数,无法被初始化,只提供静态属性和方法. 2. Number 对象 :Js中提供数字的对象.包含整数.浮 ...

  2. Harmonic Number(调和级数+欧拉常数)

    题意:求f(n)=1/1+1/2+1/3+1/4-1/n   (1 ≤ n ≤ 108).,精确到10-8    (原题在文末) 知识点:      调和级数(即f(n))至今没有一个完全正确的公式, ...

  3. Java 特定规则排序-LeetCode 179 Largest Number

    Given a list of non negative integers, arrange them such that they form the largest number. For exam ...

  4. Eclipse "Unable to install breakpoint due to missing line number attributes..."

    Eclipse 无法找到 该 断点,原因是编译时,字节码改变了,导致eclipse无法读取对应的行了 1.ANT编译的class Eclipse不认,因为eclipse也会编译class.怎么让它们统 ...

  5. 移除HTML5 input在type="number"时的上下小箭头

    /*移除HTML5 input在type="number"时的上下小箭头*/ input::-webkit-outer-spin-button, input::-webkit-in ...

  6. 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.免费应用程序调试最 ...

  7. 有理数的稠密性(The rational points are dense on the number axis.)

    每一个实数都能用有理数去逼近到任意精确的程度,这就是有理数的稠密性.The rational points are dense on the number axis.

  8. [LeetCode] Minimum Number of Arrows to Burst Balloons 最少数量的箭引爆气球

    There are a number of spherical balloons spread in two-dimensional space. For each balloon, provided ...

  9. [LeetCode] Number of Boomerangs 回旋镖的数量

    Given n points in the plane that are all pairwise distinct, a "boomerang" is a tuple of po ...

随机推荐

  1. matlab的代码注释

    1.注释一块代码: %{ 此处代码块 %} 2.注释数行代码: 先选中,然后用组合键Ctrl+R 取消注释,用组合键Ctrl+T 3.双%%的作用:代码分块运行,点击双%%之间的代码,再点Run Se ...

  2. LightOJ 1070 Algebraic Problem:矩阵快速幂 + 数学推导

    题目链接:http://lightoj.com/volume_showproblem.php?problem=1070 题意: 给你a+b和ab的值,给定一个n,让你求a^n + b^n的值(MOD ...

  3. 取分组TOPN好理解案例

  4. SpringMVC之三:配置Spring MVC Controller

    一.Controller配置方式 第一种 URL对应Bean如果要使用此类配置方式,需要在XML中做如下样式配置 以上配置,访问/hello.do就会寻找ID为/hello.do的Bean,此类方式仅 ...

  5. DS:架构-1

    ylbtech-DS:架构-1 1. 类库返回顶部 1. 2. 2. 引用返回顶部 1. Api-Base\Common\OAuth2Provider\ServiceBase-OAuth2Provid ...

  6. python list列表sort、sorted、reverse排序

    列表排序:sort是修改原列表,sorted提供原列表的一个有序副本 li=[2,1,4,5,0]li.sort() #默认从小到大print li结果:[0, 1, 2, 4, 5] li=[2,1 ...

  7. wamp + wordpress 安装

    WAMP是一个windows上的php开发集成环境,一键安装php,apache和mysql,非常方便. 双击wampserver2.2exxxxxxxxxx.exe文件进行安装,安装过程中直接下一步 ...

  8. kindeditor Springmvc 整和解决图片上传问题

    1. 在编辑页面引入js <script type="text/javascript" charset="utf-8" src="${baseP ...

  9. JavaScript高级程序设计学习笔记第四章--变量、作用域和内存问题

    1.变量可能包含两种不同数据类型的值:基本类型值和引用类型值. 基本类型值指的是简单的数据段,而引用类型值指那些可能由多个值构成的对象. 2.变量复制 如果从一个变量向另一个变量复制基本类型的值,会在 ...

  10. [pe531]Chinese leftovers

    题意:1e6~1e6+5000之间任意两个之间同余方程组的解.余数为欧拉函数. 解题关键:线性筛预处理,扩展中国剩余定理暴力求解. #include<cstdio> #include< ...