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 <stdio.h> char l1[]="`1234567890-=",l2[]="QWERTYUIOP[]",l3[]="ASDFGHJKL;'",l4[]="ZXCVBNM,./"; char str[100]; int i,j; int main() { while(1) { if(!gets(str)) break; for(i=0;str[i]!='\0';i++) { for(j=0;l1[j]!='\0';j++) { if(l1[j]==str[i]) { printf("%c",l1[j-1]); break; } } for(j=0;l2[j]!='\0';j++) { if(l2[j]==str[i]) { printf("%c",l2[j-1]); break; } } for(j=0;l3[j]!='\0';j++) { if(l3[j]==str[i]) { printf("%c",l3[j-1]); break; } } for(j=0;l4[j]!='\0';j++) { if(l4[j]==str[i]) { printf("%c",l4[j-1]); break; } } if(str[i]==' ') printf("%c",' '); } } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator