2020-09-03

tech2024-11-18  1

题目2:WERTYU 题目链接:https://vjudge.net/problem/UVA-10082 题解:字符串处理 反义字符需要在前面加/,比如储存/,就需要写成//

代码 #include #include #include using namespace std; char ch[]={"`1234567890-QWERTYUIOP[]ASDFGHJKL;ZXCVBNM,."}; char ch1[]={“1234567890-=WERTYUIOP[]\SDFGHJKL;'XCVBNM,./”}; int main() { int k,i; char c; while((k=getchar())!=EOF) { c=(char)k; for(i=0;ch1[i]!=’\0’&&ch1[i]!=c;i++); if(ch1[i]==c) c=ch[i]; cout<<c; } return 0; }

最新回复(0)