A == B ?
Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 73497 Accepted Submission(s): 11600
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 <string.h>
int main(void)
{
char a[10000000],b[10000000];
while(scanf("%s",&a)!=NULL)
{
getchar();
scanf("%s",&b);
int lena = strlen(a);
int lenb = strlen(b);
if(lenb!=lena)
printf("NO\n");
if(lenb == lena)
{
for(int i = 0;i < lena;i ++)
{
if(a[i] != b[i])
{
printf("NO\n");
break;
}
}
printf("YES\n");
}
}
}