当前位置:天才代写 > tutorial > C语言/C++ 教程 > C++打印背靠背图案

C++打印背靠背图案

2017-11-03 08:00 星期五 所属: C语言/C++ 教程 浏览:603

打印下列图案:

C++打印背靠背图案

背靠背

#include <iostream>
using namespace std;

int main()
{
  int n=10;
  for(int i=1; i<=n; i++)
  {
    for(int m=0; m<n-i; m++)
      cout<<" ";
    for(int k=0; k<i; k++)
      cout<<"#";
    cout<<"  ";
    for(int n=0; n<i; n++)
      cout<<"$";
    cout<<endl;
  }

  system("pause");
  return 0;
}

 

    关键字:

天才代写-代写联系方式