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)—— xhr异步接收处理二进制数据
有时我们需要把远程的视频.图片数据异步下载下来,然后在js里进行特殊处理.比如把VR的图片特殊处理,把不同封装格式的视频做一次 转封装 处理等等,这类操作都要先获取二进制数据,然后特殊处理. 这个时候 ...
- AtCoder Grand Contest 010 C:Cleaning
题目传送门:https://agc010.contest.atcoder.jp/tasks/agc010_c 题目翻译 给你一棵树,每个点有个权值,每次操作可以选择两个度数为\(1\)的结点,然后让这 ...
- poj3281Dining——网络流匹配
题目:http://poj.org/problem?id=3281 网络流做图中的匹配,注意为了限制每头牛只匹配一种食物和一种饮料,要把牛拆成两个点,之间连边权为1的边. 代码如下: #include ...
- phpmyadmin数据库密码的设置
用phpMyAdmin修改mysql数据库密码 修改mysql数据库密码方法有很多,这里向大家演示一种比较简单的方法,利用phpMyAdmin修改. 工具/原料 phpMyAdmin软件 my ...
- 12 Vue学习 项目技术栈
vue2 + vuex + vue-router + webpack + ES6/7 + less + element-ui 1:vuex: Vuex 是一个专为 Vue.js 应用程序开发的状态管理 ...
- va_list函数学习
当你的函数的参数个数不确定时,就可以使用上述宏进行动态处理,这无疑为你的程序增加了灵活性. va_list的使用方法: a) 首先在函数中定义一个具有va_list型的变量,这个变量是指向参数的指针 ...
- CF-828C
C. String Reconstruction time limit per test 2 seconds memory limit per test 256 megabytes input sta ...
- 深度解析VC中的消息传递机制
摘要:Windows编程和Dos编程,一个很大的区别就是,Windows编程是事件驱动,消息传递的.所以,要学好Windows编程,必须 对消息机制有一个清楚的认识,本文希望能够对消息的传递做一个全面 ...
- LightOJ - 1234 LightOJ - 1245 Harmonic Number(欧拉系数+调和级数)
Harmonic Number In mathematics, the nth harmonic number is the sum of the reciprocals of the first n ...
- Django 开发拓展 auth 模块,注册用户时发生 ValueError: The given username must be set
原因 使用局部钩子函数 _clean_fields() 对 username.email 字段进行验证时,未返回,具体请参考 _clean_fields() 函数源码. def clean_usern ...