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 这么水的题居然错了好几次...主要几个点1.这个数有可能有小数点2.也是为什么我没AC...字符数组开小了...题目里没给大小我开了10000最后改成100000就AC了...#include<cstdio> #include<cstring> char a1[100000],b[100000]; void quchu(char a[]){//去除末尾0的影响 int len,i; len=strlen(a); if(strstr(a,".")){ for(i=len-1;a[i]=='0';i--){ a[i]='\0'; len--; } } if(a[len-1]=='.') a[len-1]='\0'; } int main(){ while(scanf("%s%s",a1,b)!=EOF){ quchu(a1); quchu(b); if(strcmp(a1,b)) printf("NO\n"); else printf("YES\n"); } return 0; }