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 |
Re:有没有好的测试数据,我本机测试都好的,提交却WAIn Reply To:有没有好的测试数据,我本机测试都好的,提交却WA Posted by:Refyl at 2007-05-13 16:35:51 #include <stdio.h> #include <string.h> #include <stdlib.h> int cmp( const void *a , const void *b ) { return *(char *)a - *(char*)b; } int main(){ int i,len,j,flag; char c[100],cr[100],m[100]; scanf("%s",c); scanf("%s",m); for(i=0;c[i];i++); len=i; qsort(c,len,sizeof(char),cmp); qsort(m,len,sizeof(char),cmp); for(i=0;i<26;i++){ for(j=0;j<len;j++){ cr[j]=c[j]+i; if(cr[j]>'Z')cr[j]-=26; } qsort(cr,len,sizeof(char),cmp); if(strcmp(cr,m)==0){ printf("YES"); return 0; } } printf("NO"); return 1; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator