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 |
此等水题为啥要16ms,附代码,求大牛解释一下#include <stdio.h> #include <string.h> int main() { char map[28] , s[100] ; int i ; scanf("%s",map) ; getchar() ; gets(s) ; for( i = 0 ; i < strlen(s) ; i++ ) { if(s[i]>='A'&&s[i]<='Z') { s[i]+=32 ; printf("%c",map[s[i]-'a']-32) ; } else if(s[i]>='a'&&s[i]<='z') printf("%c",map[s[i]-'a']) ; else printf("%c",s[i]) ; } printf("\n") ; return 0 ; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator