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

UVa 458 - The Decoder

时间:2016-08-03 18:21:03      阅读:166      评论:0      收藏:0      [点我收藏+]

标签:

https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=94&page=show_problem&problem=399

思路:题目是介绍了一种简单的加密方式,明码加上一个整数k为密码。观察输入输出可知k=-7;

#include<iostream>
#include<string>
#include<cstdio>
using namespace std;

int main()
{
 // freopen("input.txt","r",stdin);
   string s;
   int i;
   while(getline(cin,s))
   {
     for(i=0;i<s.length();i++)
         s[i]=s[i]-7;
     cout<<s<<endl;
   }
   return 0;
}

 

UVa 458 - The Decoder

标签:

原文地址:http://www.cnblogs.com/aiheshan/p/5733606.html

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