U E D R , A S I H C RSS

WERTYU/문보창

소감

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

코드

~cpp 
// 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;
}
Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:28:23
Processing time 0.0090 sec