第10周项目2-(2)

来源:互联网 发布:淘宝动态评分提升 编辑:程序博客网 时间:2024/06/03 21:05

问题及代码:

/* *copyrright (c) 2014,烟台大学计算机学院 *all rights reserved *文件名称:test.cpp *作者:赵敏 *完成日期:2014年11月3日 *版本号:v1.0 */#include<iostream>#include <cstdio>using namespace std;int main(){    int a;    char ch;    while((ch=getchar())!='\n')    {        for(a=1; a<=9; a++)            putchar(ch-a);            cout<<endl;    }    return 0;}


运行结果:

知识点总结:

       使用循环语句。

学习心得:

   输出的是竖行的。。想要横着的,不知道怎么弄

 

0 0
原创粉丝点击