| ||||||||||
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 |
路过的牛人帮我看看啊……为什么wa啊?#include <iostream> using namespace std; int main() { char a[100]; char b[81]; memset(b,'0',81); int i,n,j; cin>>a; fflush(stdin); while(gets(b))//此处去掉循环还是会wa { //gets(b); n=strlen(b); for (i=0;i<n;i++) { if (b[i]!='\n') { if (b[i]>='a'&&b[i]<='z') { j=b[i]-'a'; b[i]=a[j]; cout<<b[i]; } else { if (b[i]>='A'&&b[i]<='Z') { j=b[i]-'A'; b[i]=a[j]-32; cout<<b[i]; } else cout<<b[i]; } } } //cout<<endl; } return 0; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator