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<stdio.h> #include<string.h> int main() { int i,j; char str[300]; char str1[]="`1234567890-="; char str2[]="QWERTYUIOP[]\\"; char str3[]="ASDFGHJKL;'"; char str4[]="ZXCVBNM,./"; while(gets(str)!=NULL) { for(i=0;i<strlen(str);i++) { if(str[i]==' ') printf(" "); for(j=0;j<13;j++) { if(str[i]==str1[j]) printf("%c",str1[j-1]); else if(str[i]==str2[j]) printf("%c",str2[j-1]); else if(str[i]==str3[j]) printf("%c",str3[j-1]); else if(str[i]==str4[j]) printf("%c",str4[j-1]); } } 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