Problem Description
Give you two numbers A and B, if A is equal to B, you should print "YES", or print "NO".
Input
each test case contains two numbers A and B.
Output
for each case, if A is equal to B, you should print "YES", or print "NO".
Sample Input
1 2
2 2
3 3
4 3
Sample Output
NO
YES
YES
NO
分析:
此题在于比较以下集中情况的数据:
①数值超过数据类型范围,比如超过64位的数据
②数值有前导零(此题测试不用考虑前导零)
③数值有小数点
④数值小数点后有后导零
注意点:
数据位数一定要开大,经测试,最大一个测试数据在12000到12050之间
所以最小也得12050以上
1 #include<iostream> 2 #include<cstring> 3 using namespace std; 4 5 void gg(char *s) 6 { 7 int len=strlen(s); 8 if(strchr(s,'.')) 9 { 10 for(len-=1;s[len]=='0';len--); 11 if(s[len]=='.') 12 s[len]='