📄 1256 画8.cpp
字号:
/*
1256 画8
Time Limit : 1000 ms Memory Limit : 32768 K Output Limit : 256 K
GUN C++
*/
#include <iostream.h>
using namespace std;
const int MAX=100;
int main()
{
int n,ca,high,cb,bold,temp,uplen,downlen,now;
char fill,line[MAX]={0},line2[MAX]={0};
cin>>n;
for(ca=0;ca<n;ca++)
{
cin>>fill>>high;
bold=1;temp=high;
while(temp>=6)
{ bold++;temp-=6;}
uplen=(high-3)/2;
downlen=high-3-uplen;
now=0;
for(cb=0;cb<bold;cb++,now++)
{ line[now]=' ';}
for(cb=0;cb<downlen;cb++,now++)//下圈内径为正方形
{ line[now]=fill;}
line[now]='\0';
now=0;
for(cb=0;cb<bold;cb++,now++)
{ line2[now]=fill;}
for(cb=0;cb<downlen;cb++,now++)
{ line2[now]=' ';}
for(cb=0;cb<bold;cb++,now++)
{ line2[now]=fill;}
line2[now]='\0';
//第一行
cout<<line<<endl;
for(cb=0;cb<uplen;cb++)
cout<<line2<<endl;
cout<<line<<endl;
for(cb=0;cb<downlen;cb++)
cout<<line2<<endl;
cout<<line<<endl;
if(ca!=n-1)
{ cout<<endl;}
}
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -