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 |
Why WA???Help#include<stdio.h> #include<string.h> int sum(int); int main(void) { int i,flag=0; char key[26],message[100]; gets(key); gets(message); if(message[0]>='A'&&message[0]<='Z') { message[0]+=32; flag=1; } for(i=0;i<strlen(message);i++) { if(message[i]==' ') { printf(" "); continue; } if(i!=0)printf("%c",key[message[i]-'a']); else printf("%c",(flag==1)?key[message[i]-'a']-32:key[message[i]-'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