HDU 2054 A==B?
来源:互联网 发布:广州多益网络 徐波 编辑:程序博客网 时间:2024/06/06 03:59
A == B ?Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 90991 Accepted Submission(s): 14492Problem DescriptionGive you two numbers A and B, if A is equal to B, you should print "YES", or print "NO".Inputeach test case contains two numbers A and B.Outputfor each case, if A is equal to B, you should print "YES", or print "NO".Sample Input1 22 23 34 3Sample OutputNOYESYESNOAuthor8600 && xhdSource校庆杯Warm Up技巧很独特,独辟蹊径~
#include<cstdio>#include<cstring>using namespace std;#define MAX 100100char A[MAX],B[MAX];/*后面有多余的0全部变成字符数组结尾标志'\0'如果出现2.000 和 2这样的情况 把'.'变成'\0' */ void Clean(char str[]){ int len=strlen(str),i; //注意strchr()函数返回的是一个指针 if(strstr(str,".")!=NULL){ for(i=len-1;str[i]=='0';i--) str[i]='\0'; if(str[i]=='.') str[i]='\0'; }}int main(){ while(scanf("%s%s",A,B)!=EOF){ Clean(A); Clean(B); //strcmp()完全相等时返回0 if(strcmp(A,B)!=0) printf("NO\n"); else printf("YES\n"); }}
0 0
- HDU 2054 A == B ?
- HDU 2054 A==B
- hdu acm 2054 A == B ?
- hdu - 2054 - A == B ?
- hdu 2054 A == B ?
- 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 ? [字符串]
- HDU 2054 - A == B ?
- HDU 2054 A == B ?
- HDU-2054 A==B?
- HDU 2054 A==B? 大数
- HDU 2054 A == B ?
- hdu 2054A == B ?
- Windows(WinAPI)窗口创建后,依次接收的消息
- 树莓派 Learning 002 装机后必要的操作 --- 10 实现本地电脑与远程桌面之间复制粘贴(传输)文件
- windows常用消息大全(系统消息、通告消息、用户消息)
- SendMessage 函数参数大全
- Dreamweaver CS 5 快捷键大全
- HDU 2054 A==B?
- nginx配置虚拟域名
- phpexcel导出图片
- hdu 2047 阿牛的EOF牛肉串
- centos安装redis3.0及phpredis扩展使用
- Windows使用mklink建立“符号链接”
- hdu 1160 FatMouse's Speed(LIS)
- Android内存泄漏的8种可能
- lis算法解析