Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

能帮我看看吗,总是Runtime Error...?

Posted by clwey at 2006-04-02 15:51:48 on Problem 1917
#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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator