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 |
也可以更精练一些,嘻嘻,这样打表ok~ 一开始 " ` " 弄错了 wa了两次,555#include<stdio.h> #include<string.h> char map[60]="`1234567890-=QWERTYUIOP[]\\ASDFGHJKL;'ZXCVBNM,./"; int main() { char in[100]; void f(char x); int i; while(gets(in)!=NULL) { for(i=0;i<strlen(in);i++) { f(in[i]); } printf("\n"); } return 0; } void f(char x) { int i; if(x==' ') { printf(" "); return; } for(i=0;i<60;i++) { if(x==map[i]) { printf("%c",map[i-1]); break; } } } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator