More actions
imported>Unknown No edit summary |
(Repair batch-0002 pages from live compare) |
||
| Line 8: | Line 8: | ||
{ | { | ||
map<char, char> m; | map<char, char> m; | ||
m | m['a'] = 'D'; | ||
m | m['$'] = 't'; | ||
m | m['9'] = 'p'; | ||
m | m['*'] = 'k'; | ||
m | m['m'] = 'n'; | ||
m | m['i'] = 'l'; | ||
m | m['x'] = 'W'; | ||
m | m['d'] = 'o'; | ||
m | m['='] = 's'; | ||
m | m['z'] = '!'; | ||
m | m['-'] = 'u'; | ||
m | m['@'] = 'e'; | ||
m | m['y'] = 'a'; | ||
m | m[' '] = ' '; | ||
char s | char s[30] = "ad md$ =i@@9z xy*@ -9z"; | ||
//cin.getline(s, 30); | //cin.getline(s, 30); | ||
for (int i = 0; i < strlen(s); i++) | for (int i = 0; i < strlen(s); i++) | ||
cout << m | cout << m[s[i]]; | ||
cout << endl; | cout << endl; | ||
} | } | ||
---- | ---- | ||
STL실습, 데블스캠프2004/목요일 | |||
Latest revision as of 00:16, 27 March 2026
#include <iostream>
#include <string>
#include <algorithm>
#include <map>
using namespace std;
void main()
{
map<char, char> m;
m['a'] = 'D';
m['$'] = 't';
m['9'] = 'p';
m['*'] = 'k';
m['m'] = 'n';
m['i'] = 'l';
m['x'] = 'W';
m['d'] = 'o';
m['='] = 's';
m['z'] = '!';
m['-'] = 'u';
m['@'] = 'e';
m['y'] = 'a';
m[' '] = ' ';
char s[30] = "ad md$ =i@@9z xy*@ -9z";
//cin.getline(s, 30);
for (int i = 0; i < strlen(s); i++)
cout << m[s[i]];
cout << endl;
}
STL실습, 데블스캠프2004/목요일