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 |
我晕,那错了?#include<iostream> #include<map> #include<string.h> using namespace std; map<char,char>mm; int main() { char ch[30]; char s[85]; cin.getline(ch,30,'\n'); cin.getline(s,85,'\n'); for(int i=0;i<26;++i) mm.insert(make_pair(char('a'+i),ch[i])); int len=strlen(s); for(int i=0;i<len;++i) { if(s[i]>='A'&&s[i]<='Z')cout<<(char)toupper(mm[tolower(s[i])]); else if(s[i]>='a'&&s[i]<='z')cout<<mm[s[i]]; else cout<<mm[s[i]]; } getchar(); return 0; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator