No older revisions available
No older revisions available
Map/권정욱 ¶
맵 프로그래밍 ¶
~cpp #include <iostream> #include <map> #include <fstream> #include <string> using namespace std; int main(){ ifstream fin("line.txt"); map<char, char> order; order['a'] = 'D'; order['$'] = 't'; order['9'] = 'p'; order['*'] = 'k'; order['m'] = 'n'; order['i'] = 'l'; order['x'] = 'W'; order['d'] = 'o'; order['='] = 's'; order['z'] = '!'; order['-'] = 'u'; order['@'] = 'e'; order['y'] = 'a'; order[' '] = ' '; char line; int i = 0; while(!fin.eof()){ fin.get(line); cout << order[line]; } cout << endl; return 0; }
STL실습