码迷,mamicode.com
首页 > 其他好文 > 详细

1.1字符菱形

时间:2018-02-07 21:27:58      阅读:161      评论:0      收藏:0      [点我收藏+]

标签:gpo   using   names   include   space   一个   构造   highlight   std   

描述

给定一个字符,用它构造一个对角线长5个字符,倾斜放置的菱形。

输入输入只有一行, 包含一个字符。输出该字符构成的菱形。样例输入
*
样例输出
  *
 ***
*****
 ***
  *




#include<iostream> #include<cmath> #include<cstring> #include<ctime> #include<cstdio> #include<iomanip> #include<queue> using namespace std; int main() { char a; cin>>a; cout<<" "<<a<<endl; cout<<" "<<a<<a<<a<<endl; cout<<a<<a<<a<<a<<a<<endl;cout<<" "<<a<<a<<a<<endl; cout<<" "<<a<<endl; return 0; }

  

1.1字符菱形

标签:gpo   using   names   include   space   一个   构造   highlight   std   

原文地址:https://www.cnblogs.com/lipeiyi520/p/8428129.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!