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

HELP!!!!!!!!!答案一样,why wrong answer!!!!!!!!!!!!

Posted by beijing2008 at 2006-05-03 16:42:12 on Problem 1298
#include<stdio.h>
#include<iostream.h>
#include<ctype.h>
#include<string.h>
#include<memory.h>
int main()
{
	char s[205];
	cin.getline(s,205);
	while(strcmp(s,"ENDOFINPUT")!=0)
	{
		memset(s,'$',sizeof(s));
		cin.getline(s,205);
		int i=0;
		while(s[i]!='$')
		{
			if(isalpha(s[i])==1)
			{	if(s[i]=='A'||s[i]=='B'||s[i]=='C'||s[i]=='D'||s[i]=='E')
				s[i]+=21;
				else s[i]-=5;
			}
			i++;
		};
		s[i]='\0';
		cout<<s<<endl;
		cin.getline(s,205);cin.getline(s,205);
	};
	return 0;
}

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