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
// too young
1 #include<stdio.h> 2 int main() 3 { 4 int a, b; 5 while(scanf("%d %d", &a, &b)!=EOF) 6 { 7 if(a==b) printf("YES "); 8 else printf("NO "); 9 } 10 return 0; 11 }
// double只能表示15或16位有效数字,而这道题数字可能会十分长
// 传送门:准确详解:C/C++ float、double数据类型的表示范围及精度
1 #include<stdio.h> 2 #include<stdlib.h> 3 int main() 4 { 5 double a,b; 6 char num1[1000000], num2[1000000]; 7 while(scanf("%s %s", num1, num2)!=EOF) 8 { 9 a=atof(num1); b=atof(num2); 10 if(a==b) printf("YES "); 11 else printf("NO "); 12 } 13 return 0; 14 }
// 小数点后无意义的零要删去
1 #include<stdio.h> 2 #include<string.h> 3 char a[1000000], b[1000000]; 4 void process(char *num) 5 { 6 int len=strlen(num); 7 if(strstr(num,".")!=NULL) 8 { 9 while(num[--len]=='0'); 10 if(num[len]=='.') 11 num[len]='