Toggle menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

WERTYU/문보창

From ZeroWiki

소감

2005/02/19 Accepted 0:00.002 64 뻔한 문제였다. 문제의 발상이 굉장히 재밌다.

코드

// no10082 - WERTYU
#include <iostream>
#include <cstring>
using namespace std;

int main()
{
	char diction[] = "`1234567890-=QWERTYUIOP[] ASDFGHJKL;'ZXCVBNM,./";
	diction[25] = 92;				// ASCII 92 IS 
	char str[256];
	int i, j;
	int len_dic, len_str;
	len_dic = strlen(diction);
	while (cin.getline(str, 256, '\n'))
	{
		len_str = strlen(str);
		for (i=0; i<len_str; i++)
		{
			if (str[i] == ' ')
				continue;
			for (j=0; j<len_dic; j++)
			{
				if (str[i] == diction[j])
				{
					str[i] = diction[j-1];
					break;
				}
			}
		}
		cout << str << endl;
	}
	return 0;
}

WERTYU 문보창