1004:字符三角形
时间限制: 1000 ms 内存限制: 66536 KB
提交数: 76257 通过数: 41804
【题目描述】
给定一个字符,用它构造一个底边长5个字符,高3个字符的等腰字符三角形。
【输入】
输入只有一行,包含一个字符。
【输出】
该字符构成的等腰三角形,底边长5个字符,高3个字符。
【输入样例】
*
【输出样例】
*
#include <bits/stdc++.h>
using namespace std;
int main()
{
char ch; //char定义字符变量,字符变量只包括一个字符
cin>>ch;
cout<<" "<<" "<<ch<<endl;
cout<<" "<<ch<<ch<<ch<<endl;
cout<<ch<<ch<<ch<<ch<<ch<<endl;
return 0;
}