码迷,mamicode.com
首页 > 其他好文 > 详细

POJ 3749

时间:2014-09-15 22:47:59      阅读:264      评论:0      收藏:0      [点我收藏+]

标签:blog   io   os   ar   for   div   art   sp   log   

第一道简单密码学的题,太水了,本不打算做,第一道,还是纪念一下。

#include <iostream>
#include <cstdio>
#include <cstring>
#include <string.h>
#include <algorithm>

using namespace std;

char trans[30]={‘V‘,‘W‘,‘X‘,‘Y‘,‘Z‘,‘A‘,‘B‘,‘C‘,‘D‘,‘E‘,‘F‘,‘G‘,‘H‘,‘I‘,‘J‘,
				‘K‘,‘L‘,‘M‘,‘N‘,‘O‘,‘P‘,‘Q‘,‘R‘,‘S‘,‘T‘,‘U‘};

char en[20];
char scode[200];

bool readin(){
	gets(en);
	if(strcmp(en,"START")==0)
	return true;
	return false;
}

int main(){
	while(readin()){
		gets(scode);
		for(int i=0;scode[i]!=‘\0‘;i++){
			if(scode[i]<‘A‘||scode[i]>‘Z‘)
			cout<<scode[i];
			else 
			cout<<trans[scode[i]-‘A‘];
		}
		cout<<endl;
		gets(en);
	}
	return 0;
}

  

POJ 3749

标签:blog   io   os   ar   for   div   art   sp   log   

原文地址:http://www.cnblogs.com/jie-dcai/p/3973849.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!