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

哪位大牛帮我看一下这程序到底错哪了,先谢谢了!!!

Posted by scaneeling at 2008-07-29 13:26:32 on Problem 2538
#include<iostream>
#include<string>
using namespace std;
int main()
{
	while(1){
	char a[80]={'/', '.', ',', 'M', 'N', 'B', 'V', 'C', 'X','Z','\'', ';', 'L', 'K', 'J', 'H', 'G', 'F', 'D','S','A','\\', 
		']', '[', 'P', 'O', 'I', 'U', 'Y', 'T', 'R', 'E', 'W', 'Q','=', '-','0', '9', '8', '7', '6', '5', '4', '3','2','1','`'};
	int i,j;
	char b[10000];
	gets(b);
	for(i=0;i!=strlen(b);++i)
	{
		if(b[i]!=' ')
		{
			for(j=0;j!=50;++j)
			{
				if(b[i]==a[j])
					break;
			}
			cout<<a[j+1];
		}
		else 
			cout<<b[i];
	}
	cout<<endl;}
	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