當前位置:編程學習大全網 - 編程軟體 - c++編程 for循環

c++編程 for循環

const?char?XING?=?'#';

int?main()

{

for?(int?i?=?0;?i?<?4;?++i)

{

for?(int?k?=?i;?k?<?3;?++k)

{

cout?<<?"?";

}

for?(int?j?=?0;?j?<=?i;?++j)

{

cout?<<?XING?;

}

cout?<<?"?";

for?(j?=?0;?j?<=?i;?++j)

{

cout?<<?XING?;

}

cout?<<?endl;

}

for?(i?=?4;?i?>?0;?--i)

{

for?(int?k?=?4;?k?>?i;?--k)

{

cout?<<?"?";

}

for?(int?j?=?i;?j?>?0;?--j)

{

cout?<<?XING?;

}

cout?<<?"?";

for?(j?=?i;?j?>?0;?--j)

{

cout?<<?XING?;

}

cout?<<?endl;

}

return?0;

}

  • 上一篇:2022年深圳橫崗六約麟恒中心廣場商鋪有沒有賣的
  • 下一篇:零基礎自學IT開發有哪些缺點
  • copyright 2024編程學習大全網