Description
Given a character, use it to construct a waist character triangle of 5 characters and 3 characters in height.
Input
There is only one line input, including one character.
OUTPUT
The waist triangle composed of this character has 5 characters on the bottom and 3 characters high.
Input Sample
*
OUTPUT SAMPLE
*
***
*****
source
Exercise (2-7)
idea
Just output with Cout or Printf.
Answer
CPP
include
using namespace std;
int Main ()
{{
char a;
cin >> a;
COUT << "" << A << Endl;
cout << "" << a << a << Endl;
COUT << a << a << a <<< a;
Return 0;
}
Result
Used Memory: 200KB
Run time: 11ms
Language: G ++
Submit time: 2019-03-24 09:19:48
Proplem Link
[http://noi.openjudge.cn/ch0101/08/> [1]
OpenJudge 08:Character triangle
Comments