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

Re:分享下代码

Posted by 398564501 at 2011-07-26 11:23:42 on Problem 1298
In Reply To:分享下代码 Posted by:cailizhong at 2010-07-30 23:18:17
#include<iostream>

#include<cstring>
using namespace std;

char a[100];


int main()
{
	//V W X Y Z A B C D E F G H I J K L M N O P Q R S T U
	a[1]='V';
	a[2]='W';
	a[3]='X';
	a[4]='Y';
	a[5]='Z';
	a[6]='A';
	a[7]='B';
	a[8]='C';
	a[9]='D';
	a[10]='E';
	a[11]='F';
	a[12]='G';
	a[13]='H';
	a[14]='I';
	a[15]='J';
	a[16]='K';
	a[17]='L';
	a[18]='M';
	a[19]='N';
	a[20]='O';
	a[21]='P';
	a[22]='Q';
	a[23]='R';
	a[24]='S';
	a[25]='T';
	a[26]='U';

	char s[210];

	while(1)
	{ 
		cin.getline(s,200);
		if(strcmp(s,"ENDOFINPUT")==0)break;
		else if(strcmp(s,"END")==0)continue;
		else if(strcmp(s,"START")==0)continue;
		else 
		{
			for(int i=0;i<strlen(s);i++)
			{
				if(s[i]>='A'&&s[i]<='Z')
				cout<<a[s[i]-'A'+1];
				else cout<<s[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