hdu 2054
2011-09-01 11:08
232 查看
[align=center] [/b][/align] [align=center](有更新)2011ACM/ICPC亚洲区中国大陆5个赛区信息汇集~[/b][/align] |
A == B ?Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 29789 Accepted Submission(s): 4579 [align=left]Problem Description[/align] Give you two numbers A and B, if A is equal to B, you should print "YES", or print "NO". [align=left]Input[/align] each test case contains two numbers A and B. [align=left]Output[/align] for each case, if A is equal to B, you should print "YES", or print "NO". [align=left]Sample Input[/align] 1 2 2 2 3 3 4 3 [align=left]Sample Output[/align] NO YES YES NO [align=left]Author[/align] 8600 && xhd [align=left]Source[/align] 校庆杯Warm Up [align=left]Recommend[/align] |
#include <stdio.h> #include <string.h> #include <stdlib.h> char str1[100000], str2[100000]; void deal(char *str) { int i, j, len; char *p = str; while( *p == '0') p++; strcpy(str, p); if(strchr(str, '.')) { len = strlen(str); p = len + str - 1; while( *p == '0') *(p--) = 0; if (*p == '.') *p = 0; } } int main( ) { while(scanf("%s%s", str1,str2)!= EOF) { deal(str1); deal(str2); if (strcmp(str1, str2) == 0) puts("YES"); else puts("NO"); } return 0; }
相关文章推荐
- Hdu 2054 A == B ?
- HDU 2054 A == B 【String 的骚操作 , string find 的应用】
- HDU 2054 A==B?
- hdu 1055 poj 2054 映射二叉堆
- hdu 2054 A == B ?
- hdu 2054 A == B ?
- HDU-2054 A == B? Java
- HDU 2054
- HDU-2054 A==B?
- hdu 2054 A == B ? (java)
- HDU 2054 A == B ?
- hdu 2054 A==B?
- HDU 2054 A==B? 大数
- HDU 2054 A == B ?
- hdu 2054 A == B ? (java大数)
- hdu 1055 & poj 2054 Color a Tree 树&贪心 找最大费用点和父节点合并
- hdu 2054 A == B ? 坑人的题目
- hdu 2054
- HDU 2054 A == B ?A
- HDU 2054 大数比较