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<iostream> #include<algorithm> using namespace std; int main() { int i,j,m,n,l; char a[20],b[20],d[100],e[20]; char c[10][10]; while(cin>>a&&strcmp( a, "THEEND")!=0) { cin>>d; n=0; strcpy(b,a); strcpy(e,a); sort(b,b+strlen(a)); for(i=0;i<strlen(a);i++) for(j=0;j<strlen(a);j++) { if(e[j]==b[i]) { e[j]='0'; for(m=0;m<(strlen(d)/strlen(a));m++,n++) { c[m][j]=d[n]; } break; } } for(l=0;l<strlen(d)/strlen(a);l++) for(i=0;i<strlen(a);i++) { cout<<c[l][i]; } cout<<endl; } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator