mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
Create 1641.cpp
This commit is contained in:
parent
7c9dae7c36
commit
32cafdfadc
38
QUSTOJ/1641.cpp
Normal file
38
QUSTOJ/1641.cpp
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
#include <cstdio>
|
||||||
|
#include <cstdlib>
|
||||||
|
#include <cstring>
|
||||||
|
using namespace std;
|
||||||
|
//WTF!!! I still have to use this function!
|
||||||
|
int strlenx(const char* inc)
|
||||||
|
{
|
||||||
|
int i=0;
|
||||||
|
while(inc[i]!='\0') i++;
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
const char* keyboard="`1234567890-=~!@#$%^&*()_+QWERTYUIOP[]\\ASDFGHJKL;'ZXCVBNM,./M<>?L:\"P{}|";
|
||||||
|
char change(char inc)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
int len=strlenx(keyboard);
|
||||||
|
for(i=0;i<len;i++)
|
||||||
|
{
|
||||||
|
if(inc==keyboard[i])
|
||||||
|
{
|
||||||
|
return keyboard[i-1];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return inc;
|
||||||
|
}
|
||||||
|
char cmdline[1024];
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
gets(cmdline);
|
||||||
|
int len=strlenx(cmdline);
|
||||||
|
int i;
|
||||||
|
for(i=0;i<len;i++)
|
||||||
|
{
|
||||||
|
cmdline[i]=change(cmdline[i]);
|
||||||
|
}
|
||||||
|
puts(cmdline);
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user