A == B ?
Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 64227 Accepted Submission(s): 10057
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题目大意:看a是不是等于b 思路:分非常多种情况。有符号无符号,或者0.1 和 .1是相等的,还要注意没实用的0 我把前边后边无用的0都去掉,再分情况推断符号的问题,小数点的问题,代码 好长,有个非常短的代码,也过了,可是01和1,+1和1,等非常多情况測试都不正确,可是 竟然对了!,,,不太理解。
附上大神超短代码。 2014,11,9 这题真烦人!
#include<stdio.h> #include<string.h> char a[150000],b[150000],c[150000],d[150000]; int main(){ int i,j,k,l,lena,lenb; while(scanf("%s%s",a,b)!=EOF){ lena=strlen(a);lenb=strlen(b); for(i=0;i<lena;i++){ if(a[i]=='.'){ for(j=lena-1;j>=0;j--){ if(a[j]!='0'){ a[j+1]='