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:还让我试了几个WA,晕,不过也让我知道了有MAP可用,程序借用了,OK??

Posted by mayp at 2007-03-12 16:56:38 on Problem 2141
In Reply To:我晕,那错了? Posted by:sunnvya at 2006-09-30 22:27:27
> #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]];////////=>cout<<s[i]; 
>     
>     
>     }
>    getchar();
>    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