hdu2054 A == B ?(高精度比较)
来源:互联网 发布:李连杰眼睛 知乎 编辑:程序博客网 时间:2024/05/22 02:01
A == B ?
Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 56411 Accepted Submission(s): 8680
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 22 23 34 3
Sample Output
NOYESYESNO
#include<stdio.h>#include<string.h>char a[100004],b[100004];int dot(char x[]){ int len=strlen(x),i; for(i=0; i<len; i++) { if(x[i]=='.') { int j=len-1; while(x[j]=='0') {//去掉末尾的零 len--; j--; } break; } } if(x[len-1]=='.') len--;//去掉整数的小数点 return len;}int main(){ while(scanf("%s%s",a,b)!=EOF) { int la=dot(a),lb=dot(b); if(la!=lb) { printf("NO\n"); continue; } bool ok=1; for(int i=0; i<la; i++) if(a[i]!=b[i]) { ok=0; break; } if(ok) printf("YES\n"); else printf("NO\n"); } return 0;}
0 1
- hdu2054 A == B ?(高精度比较)
- BFS:HDU2054-A==B?(字符串的比较)
- Hdu2054:A==B?大数高精度算法
- hdu2054 A == B ?
- HDU2054:A == B ?
- HDU2054 A == B?
- HDU2054---A == B ?
- HDU2054 A==B?
- HDU2054--A==B?
- hdu2054 A == B ?
- A == B ?(HDU2054)
- HDU2054 A == B ?
- hdu2054 A == B ?
- hdu2054 A == B ?
- HDU2054---A==B?
- HDU2054 A == B ? 模拟题
- 【坑】HDU2054 A==B?
- hdu2054 A == B ?【大数】
- 抽象描述排序算法(不适合初学者)
- Fuzhou Problem 1920 Left Mouse Button
- C# DataSet.AcceptChanges 方法
- 关于Struts2.1.6中配置 constant name="struts.devMode" value="true" 在tomcat启动时报错的问题
- jersey client 发送Post请求 【带参数】
- hdu2054 A == B ?(高精度比较)
- Android数据库的使用
- 一个不错的java的配置文件的设置
- python学习1
- 3d ListView翻译
- 管理Activity
- [Android]自定义dialog
- [Java基础]
- [Java]java反射随笔