#include<iostream>
#include <fstream>
using namespace std
int main(void)
{
int line,i,j
char ch
cout<<"How many lines?"<<endl
cin>>line
cout<老氏早<"What character?"<<核卜endl
cin>侍雀>ch
for(i=1i<=linei++)
{
for(j=linej>=ij--)
cout<<" "
for(j=1j<=2*i-1j++)
cout<<ch<<" "
cout<<endl
}
return 0
}
最简单姿氏枝的方法,不像其他人那么麻烦迹敏核李的
#include <stdio.h>void main ()
{
printf ("*\n***\n*****\n***\n*")
}
这是五裂悔边形含汪的~~四边形的谈源仔调用一函数就行了
#include <graphics.h>
main()
{
int drive,mode,i,j,m,n
drive=DETECT
initgraph(&drive,&mode,"")
i=getmaxx()
j=getmaxy()
m=i/2
n=j/2
cleardevice()
line(m,n-38.5,m-40,n-9)
line(m,n-38.5,m+40,n-9)
line(m-40,n-9,m-25,n+38.5)
line(m+40,n-9,m+25,n+38.5)
line(m-25,n+38.5,m+25,n+38.5)
getch()
closegraph()
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)