1083. Is It a Number

单点时限: 2.0 sec

内存限制: 256 MB

In some programming languages(like C/C++), we define numbers like this:

number -> digits optional_fraction optional_exponent

optional_exponent -> [empty] | E digits | E-digits |-digitsE-digits

digits -> digit | digits digit

digit -> [0-9]

Given a string, you have to tell whether it is a legal number.

输入格式

The first line of input contains an integer T(1<=T<=120) which indicate the number of test cases. Then T test cases follow. Each test case contains one line. Each line contains a string whose length will not exceed 200.

输出格式

For each test case, you have to tell whether the string is a legal number. If it is a legal number, output “YES” in a single line, otherwise, output “NO” in a single line.

样例

Input
6
0123
123.456
0.456E-5
123 456
0.456EF
****0.24**
-2E-2
.2
2.
(*表示空格)
Output
YES
YES
YES
NO
NO
YES
YES
NO
NO

3 人解决,40 人已尝试。

6 份提交通过,共有 194 份提交。

9.6 EMB 奖励。

创建: 17 年,8 月前.

修改: 7 年,2 月前.

最后提交: 3 年,8 月前.

来源: partychen

题目标签