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

为什么RUN TIME ERROR?

Posted by 00448200 at 2005-03-18 19:42:56 on Problem 1298
#include<iostream.h>
#include<string.h>
char a[250];
char b[250];
char*start="START";
char*end="END";
char*over="ENDOFINPUT";
void main()
{
	int i,j;
	while(1)
	{
		i=0;
		while((a[i]=cin.get())!='\n')i++;
		a[i]='\0';
		if(!strcmp(a,over))break;
		if(strcmp(a,start)&&strcmp(a,end))
		{
			for(j=0;j<i;j++)
			{
				if(a[j]>='A'&&a[j]<='Z')
				{
					a[j]-=5;
					if(a[j]<'A')a[j]+=26;
				}
				b[j]=a[j];
			}
			b[j]='\0';
		}
		if(!strcmp(a,end))cout<<b<<endl;
	}
}

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