| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
Re:分享下代码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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator