为什么会WA?????????????
查看原帖
为什么会WA?????????????
92805
_RedForest楼主2020/9/21 00:03

#include <iostream>
#include <cstdio>
using namespace std;
const int inf=2e2+7;
char s[inf]="`1234567890-=QWERTYUIOP[]\\ASDFGHJKL;'ZXCVBNM,./",temp;
inline int quiry(const char x){
	for(int i=0;s[i];i++){
		if(s[i]==x)return i;
	}
	return -1;
}
int main(){
	int pos;
	freopen("a.in","r",stdin); 
	while(scanf("%c",&temp)!=EOF){
		pos=quiry(temp);
		if(pos==-1)cout<<temp;
		else cout<<s[pos-1];
	}
	return 0;
} 
2020/9/21 00:03
加载中...