第十周 项目二--M$pszi$y是嘛意思---不知加密数字,列出所有可能

来源:互联网 发布:淘宝开店名字 编辑:程序博客网 时间:2024/05/06 15:55

问题及代码:

/*
*Copyright (c) 2014,烟台大学计算机学院
*All rights reserved.
*文件名称:test.cpp
*作者:吴胜男
*完成日期:2014年11月3日
*版本号:v1.0
*
*问题描述:M$pszi$y 是嘛意思
*输入描述:
*程序输出:
*/
#include<iostream>
#include <cstdio>
using namespace std;
int main()
{
    int a,b;
    for(a=1;a<=9;a++)
    {
        cin>>b;
        char ch;
        getchar();
        while((ch=getchar())!='\n')
      {
        putchar(ch-b);
      }
    }
      return 0;
}
运行结果:

知识点总结:学会运用for循环,可以在原来程序的基础上进行修改得到结果。

学习心得:大胆尝试!!

0 0