本文共 1593 字,大约阅读时间需要 5 分钟。
字母替换
// Test.cpp : Defines the entry point for the console application.////#include "stdafx.h"#include #include #include #include #include using namespace std;int main(){ map chatMap; chatMap.insert(make_pair('a', 'y')); chatMap.insert(make_pair('b', 'h')); chatMap.insert(make_pair('c', 'e')); chatMap.insert(make_pair('d', 's')); chatMap.insert(make_pair('e', 'o')); chatMap.insert(make_pair('f', 'c')); chatMap.insert(make_pair('g', 'v')); chatMap.insert(make_pair('h', 'x')); chatMap.insert(make_pair('i', 'd')); chatMap.insert(make_pair('j', 'u')); chatMap.insert(make_pair('k', 'i')); chatMap.insert(make_pair('l', 'g')); chatMap.insert(make_pair('m', 'l')); chatMap.insert(make_pair('n', 'b')); chatMap.insert(make_pair('o', 'k')); chatMap.insert(make_pair('p', 'r')); chatMap.insert(make_pair('q', 'z')); chatMap.insert(make_pair('r', 't')); chatMap.insert(make_pair('s', 'n')); chatMap.insert(make_pair('t', 'w')); chatMap.insert(make_pair('u', 'j')); chatMap.insert(make_pair('v', 'p')); chatMap.insert(make_pair('w', 'f')); chatMap.insert(make_pair('x', 'm')); chatMap.insert(make_pair('y', 'a')); chatMap.insert(make_pair('z', 'q')); FILE* pf = fopen("out.txt", "w+"); int caseNum = 0; scanf("%d\n", &caseNum); char* s = (char*)malloc(10000 * sizeof(char)); string* t = new string[caseNum]; memset(s, 0, 10000 * sizeof(char)); for(int i = 0; i ::iterator iter; for(int j = 0; j second); } } for(int k = 0; k
转载于:https://www.cnblogs.com/dangerman/archive/2013/03/14/2959504.html