From c22d476980327fd93db6ee6a1f7dda4120bcd431 Mon Sep 17 00:00:00 2001 From: KiritoTRw <3021577574@qq.com> Date: Sun, 22 May 2016 23:27:37 +0800 Subject: [PATCH] Create 1631.c --- QUSTOJ/1631.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 QUSTOJ/1631.c diff --git a/QUSTOJ/1631.c b/QUSTOJ/1631.c new file mode 100644 index 0000000..5140094 --- /dev/null +++ b/QUSTOJ/1631.c @@ -0,0 +1,22 @@ +#include +#include +#include + +char save[] = "`1234567890-=QWERTYUIOP[]\\ASDFGHJKL;\'ZXCVBNM,./"; +char maps[512]; +char data[512]; + +int main() +{ + for ( int i = 1 ; save[i] ; ++ i ) + maps[save[i]] = save[i-1]; + + while ( gets(data) ) { + for ( int i = 0 ; data[i] ; ++ i ) + if ( data[i] == ' ' || data[i] == ' ' ) + printf("%c",data[i]); + else printf("%c",maps[data[i]]); + printf("\n"); + } + return 0; +}