/*
*Copyright (c) 2014,烟台大学计算机学院
*All rights reserved.
*文件名称: test.cpp
*作 者:李晓凡
*完成日期:2014年10月16日
*版本号:v1.0
*
*问题描述: 用*来制作三角形
*输入描述: x,y,z
*程序输出: z
*/
#include<iostream>
using namespace std;
int main()
{
int x,y,z;
for (x=1;x<7;x++)
{
for (y=6;y>x;y--)
cout<<" ";
for (z=2;z<x*2+1;z++)
cout<<"*";
cout<<endl;
}
return 0;
}
三角形
最新推荐文章于 2022-10-06 19:59:28 发布