第10周上机实践项目2——M$pszi$y是嘛意思?

来源:互联网 发布:飞飞cms 编辑:程序博客网 时间:2024/05/11 18:49

(1)将加密数字提前输入的加密手段

问题及代码

/* * Copyright (c) 2014, 烟台大学计算机学院 * All rights reserved. * 文件名称:test.cpp * 作    者:辛彬 * 完成日期:2014年 10 月 30 日 * 版 本 号:v1.0 * * 问题描述:使用密码解密。 * 输入描述:密码。 * 程序输出:解密后的字符。 */#include <iostream>#include <cstdio>using namespace std;int main(){    int m,i=1;    char ch;    do    {    cin>>m;    while((ch=getchar())!='\n')    {        putchar(ch-m);    }    cout<<endl;    cout<<endl;    i++;    }    while(i<=9);    return 0;}



运行结果:

0 0