1.1字符菱形

描述

给定一个字符,用它构造一个对角线长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; }

  

posted @ 2018-02-07 19:23  Mr^Simon  阅读(493)  评论(0编辑  收藏  举报