3 人解决,40 人已尝试。
6 份提交通过,共有 194 份提交。
9.6 EMB 奖励。
单点时限: 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.
6 0123 123.456 0.456E-5 123 456 0.456EF ****0.24** -2E-2 .2 2. (*表示空格)
YES YES YES NO NO YES YES NO NO
3 人解决,40 人已尝试。
6 份提交通过,共有 194 份提交。
9.6 EMB 奖励。