嗯 还是 暴

来源:互联网 发布:淘宝产品拍摄培训 编辑:程序博客网 时间:2024/06/06 16:36
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
NOYESYES
NO

#include<stdio.h>#include<string.h>int main(){    char a[900000],b[900000];    int i,x,z,t,l,n,j,y;    for(i=0;i<n;i++)    {        a[i]=b[i]='0';    }    while(scanf("%s%s",a,b)!=EOF)    {        x=0;        t=strlen(a);        l=strlen(b);        if(t>l)        n=t;        else        n=l;        for(i=0;i<n;i++)        {            if(a[i]!=b[i]&&(a[i]!='.'&&b[i]!='.'))            x=1;            if(a[i]=='.'||b[i]=='.')            {               i=i+1;               y=n;               z=n;               for(j=n-1;j>=i;j--)               {                   if(a[j]==0)                   y--;                   if(b[j]==0)                   z--;               }               if(z>y)               n=y;               else               n=z;               for(j=i;j<n;j++)               {                   if(a[j]!=b[j])                   x=1;                }                break;                }        }        if(x)        printf("NO\n");        else        printf("YES\n");    }    return 0;}


原创粉丝点击