[quote=引用 17 楼 lc316546079 的回复:] [quote=引用 7 楼 jiandingzhe 的回复:] 为什么要循环呢?有要求任意尺寸的菱形吗? cout<<" # \n ### \n#####\n ### \n # \n";
cout<<" # \n ### \n#####\n ### \n # \n";
[quote=引用 7 楼 jiandingzhe 的回复:] 为什么要循环呢?有要求任意尺寸的菱形吗? cout<<" # \n ### \n#####\n ### \n # \n";
为什么要循环呢?有要求任意尺寸的菱形吗? cout<<" # \n ### \n#####\n ### \n # \n";
#include<iostream.h> int main() { int i,j; for(i=1;i<=10;i++) { for(j=1;j<=10-i;j++) cout<<" "; for(j=1;j<=2*i-1;j++) cout<<"#"; cout<<endl; } } 只会写上半部分-。-
for(i=1;i<=10;i++) { for(j=1;j<=10-i;j++) cout<<" "; for(j=1;j<=19;j++) cout<<"#"; cout<<endl; }
33,311
社区成员
41,784
社区内容
加载中
试试用AI创作助手写篇文章吧