首页 > 其他 > 详细

UVa 458 - The Decoder

时间:2016-08-03 18:20:02      阅读:122      评论: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
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!