Hdu2054:A==B?大数高精度算法
来源:互联网 发布:南京外国语学校知乎 编辑:程序博客网 时间:2024/06/05 17:38
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<stdio.h>#include<stdlib.h>#include<string.h>void test(char a[],int end){ //去掉小数点后的0 if(strstr(a,".")){ //判断数组带不带小数点 while(a[end-1]=='0'){ a[end-1]='\0'; end--; } if(a[end-1]=='.'){ a[end-1]='\0'; } }}int main(){ char a[100000],b[100000]; //把数组设的足够大 while(~scanf("%s%s",a,b)){ test(a,strlen(a)); test(b,strlen(b)); if(!strcmp(a,b)) printf("YES\n"); else printf("NO\n"); } return 0;}
1 0
- 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?
- 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?
- git
- 生成签名的APK
- 1030. 完美数列(25)
- numpy,matplotlib
- Java——随机数(Random()函数)
- Hdu2054:A==B?大数高精度算法
- BZOJ 4516 后缀数组+ST+set
- 如何免费下载DJKK的音乐
- (一)MyBlock
- LEETCODE--Two Sum II - Input array is sorted
- C 练习实例5
- 根据前序、中序构建二叉树
- R函数
- dtd约束文件的引入方式