这是第二篇c++编程的文章,请审核老师过审一下,谢谢!
题目内容
用 *
构造一个对角线长 5 个字符,倾斜放置的菱形。
输入格式
没有输入要求。
输出格式
如样例所示。用 *
构成的菱形。
样例 1 输出
* *** ***** *** *
完整程序如下:
#include <iostream>
using namespace std;
int main ()
{
cout<<" *"<<endl;
cout<<" ***"<<endl;
cout<<"*****"<<endl;
cout<<" ***"<<endl;
cout<<" *"<<endl;
return 0;
}
运行结果:
*
***
*****
***
*
--------------------------------
Process exited after 0.09692 seconds with return value 0
请按任意键继续. . .