[题解]Let’s Celebrate the 100th Contest on ZOJ! » ZOJ3439hhanger

ZOJ3439hhanger
ZOJ3439hhanger.cpp


/**********************************************************************
Author: hhanger
Created Time: Thu 16 Dec 2010 04:34:45 PM CST
Last Modified Time: Thu 16 Dec 2010 04:38:27 PM CST
File Name: 1.cpp
Description:
 **********************************************************************/

#include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>

using namespace std;

#define out(x) printf("%s %lld\n", #x, (long long)(x))i

map<int, int> mp;

void gao();

int main() {
	int ch;
	gao();
	while ((ch = getchar()) != EOF) putchar(mp[ch]);
	return 0;
}

void gao() {
	for(int i = 0; i < 1000; ++i) mp[i] = i;
	mp['a'] = 'l';
	mp['b'] = 'm';
	mp['c'] = 'p';
	mp['d'] = 'j';
	mp['e'] = 'e';
	mp['f'] = 'o';
	mp['g'] = 'r';
	mp['h'] = 'u';
	mp['i'] = 'a';
	mp['j'] = 'd';
	mp['k'] = 'b';
	mp['l'] = 'c';
	mp['m'] = 'y';
	mp['n'] = 'h';
	mp['o'] = 'w';
	mp['p'] = 's';
	mp['q'] = 'z';
	mp['r'] = 'x';
	mp['s'] = 'n';
	mp['t'] = 't';
	mp['u'] = 'f';
	mp['v'] = 'g';
	mp['w'] = 'q';
	mp['x'] = 'v';
	mp['y'] = 'i';
	mp['z'] = 'k';
	for (int ch = 'A'; ch <= 'Z'; ++ch) mp[ch] = mp[ch + 32] - 32;
	map<int, int> tmp;
	for (map<int, int>::iterator mi = mp.begin(); mi != mp.end(); ++mi) tmp[mi->second] = mi->first;
	mp = tmp;
}
3 Responses to “ZOJ3439hhanger”
  1. jing says:

    但是还是不明白题目意思~~~~(>_<)~~~~

  2. jing says:

    还是hh大神的代码比较好看(*^__^*) 嘻嘻……

  3.  
Leave a Reply