1028:字符菱形
时间限制: 1000 ms 内存限制: 65536 KB
提交数: 54436 通过数: 37446
【题目描述】
给定一个字符,用它构造一个对角线长5个字符,倾斜放置的菱形。
【输入】
输入只有一行, 包含一个字符。
【输出】
该字符构成的菱形。
【输入样例】
*
【输出样例】
*
***
*****
***
*
#include<iostream>
using namespace std;
int main()
{
char x;
cin>>x;
cout<<" "<<x<<endl;
cout<<" "<<x<<x<<x<<endl;
cout<<x<<x<<x<<x<<x<<endl;
cout<<" "<<x<<x<<x<<endl;
cout<<" "<<x<<endl;
return 0;
}