A == B ?
题目描述:
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
分析:
本题并不是简单的比较1是否等于1的问题,还应该考虑到输入数据的精度和复杂度,需要用到数组来表示输入的数据。
通过答案:
#include <stdio.h>
#include<string.h>
char a[100000],b[100000]; //数组尽可能大
int change(char s[]){
int len,i;
len=strlen(s);
if(strstr(s,".")){ //判断数组s中是否包含“.”
for(i=len-1;s[i]=='0';i--){ //去掉0
s[i]='\0&#