黑色陨石换蓝色陨石:C++写出运行后的输出结果

来源:百度文库 编辑:中科新闻网 时间:2024/04/29 03:20:48
写出运行后的输出结果
3(1. include<iostream.h>
void main() {
char ch='*';
int n=5;
while(n) {
for(int i=0;i<n;i++) cout<<ch;
cout<<endl;
n--;
}
}

*****
****
***
**
*
但是你的include前要加#
变成#include<iostream.h>就对了。

我觉得是
*****
****
***

结果如下:
*****
****
***
**
*

*****
****
***
**
*