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<cstdio> #include<cstring> #include<string> #include<cmath> #include<stdlib.h> #include<algorithm> using namespace std; char s[30]; char a[150]; int main() { int i,b; scanf("%s",s); getchar(); gets(a); for(i=0;i<strlen(a);i++) { if(a[i]!=' ') { if(a[i]>='A'&&a[i]<='Z') { b=a[i]-'A'; a[i]=toupper(s[b]); } else{ b=(a[i]-'a'); a[i]=s[b]; } } } puts(a); return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator