1190: 零起点学算法97——A == B ?

电玩女神 2022-10-25 05:52 261阅读 0赞

Description

Give you two integer numbers A and B, if A is equal to B, you should print “YES”, or print “NO”.

Input

each test case contains two integer numbers A and B.

Output

for each case, if A is equal to B, you should print “YES”, or print “NO”.

" class="reference-link">Sample Input 5f8f312f51791b8bb0ed0ae07c2ffa43.gif

  1. 1 2
  2. 2 2
  3. 3 3
  4. 4 3

Sample Output

  1. NO
  2. YES
  3. YES
  4. NO

HINT

注意A、B数位最多100位。

Source

零起点学算法

Code

位数太大用数组

  1. #include<iostream>
  2. #include<stdio.h>
  3. #include<string.h>
  4. using namespace std;
  5. int main()
  6. {
  7. char a[199],b[199];
  8. while(~scanf("%s%s",&a,&b))
  9. {
  10. if(strcmp(a,b)==0)
  11. cout<<"YES"<<endl;
  12. else
  13. cout<<"NO"<<endl;
  14. }
  15. }

发表评论

表情:
评论列表 (有 0 条评论,261人围观)

还没有评论,来说两句吧...

相关阅读