HDU_2054——A=B问题

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
 #include <cstdio>
#include <cstring>
char* fun(char *str)
{
if(strchr(str,'.')!=NULL)
{
int i=strlen(str);
while(str[--i]=='');
if(str[i]=='.')
i--;
str[i+]='\0';
}
return str;
}
//不用考虑前导0的情况
int main()
{
char a[],b[];
while(~scanf("%s%s",a,b))
{
if(strcmp(fun(a),fun(b))==)
printf("YES\n");
else
printf("NO\n");
}
return ;
}
上一篇:凡事预则立-于Beta冲刺前


下一篇:.Net Core在Ubuntu的坑