| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
牛人帮忙看看 为什么总是wa#include<stdio.h>
#include<string.h>
void main()
{
int m,n,i=0,j,h,length1,length2,flag=0;
char a[100],b[100],c[100];
gets(a);
gets(b);
length1=strlen(a);
length2=strlen(b);
for(i=0;i<27;i++)
{
for(m=0;m<length2;m++)
{
for(n=0;n<length1;n++)
{
c[n]=a[n]-i;
c[length1]='\0';
if(b[m]==c[n])
flag++;
}
}
for(m=0;m<length1;m++)
{
for(n=m+1;n<=length1;n++)
{
if(b[m]==b[n]) flag=flag-2;
}
}
if(flag==length1&&i<=24) {
printf("YES\n");break;}
if (i==26&&flag<length1) {
printf("NO\n");break;}
}
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator