poj2538---字符匹配(映射)
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
#include <stdio.h> #include <stdlib.h> #include<string.h> int main() { int i,j; char arr[60],str[] = {"`1234567890-=QWERTYUIOP[]\\ASDFGHJKL;'ZXCVBNM,./"}; while(gets(arr) != NULL) { for(i=0;i<strlen(arr);i++) { if(arr[i] == ' ') putchar(' '); for(j=0;j<strlen(str);j++) { if(arr[i] == str[j]) printf("%c",str[j-1]); } } printf("\n"); } printf("\n"); return 0; }