| ||||||||||
| 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 | |||||||||
能帮我看看吗,总是Runtime Error...?#include"stdio.h"
#include"string.h"
main(){
long i,j,k,m,n,l;
char a[500],b[500],c[500],d[500],e[500],x[500],y[500],h[500];
scanf("%d",&m);
for(j=0;j<m;j++){
fflush(stdin);
gets(x);
gets(y);
k=0;i=0;
while(x[i++]!='<'){
a[k++]=x[i-1];
}
a[k]='\0';
k=0;
while(x[i++]!='>'){
b[k++]=x[i-1];
}
b[k]='\0';
k=0;
while(x[i++]!='<'){
c[k++]=x[i-1];
}
c[k]='\0';
k=0;
while(x[i++]!='>'){
d[k++]=x[i-1];
}
d[k]='\0';
k=0;
while(x[i++]!='\0'){
e[k++]=x[i-1];
}
e[k]='\0';
strcpy(h,a);
strcat(h,b);
strcat(h,c);
strcat(h,d);
strcat(h,e);
printf("%s\n",h);
l=strlen(y);
y[l-3]='\0';
strcat(y,d);
strcat(y,c);
strcat(y,b);
strcat(y,e);
printf("%s\n",y);
}
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator