OpenJudge 08:Character triangle

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

[http://noi.openjudge.cn/ch0101/08/>; [1]

OpenJudge 08:Character triangle

https://blog.tsinbei.com/en/archives/200/

Author
Hsukqi Lee
Posted on

2022-02-21

Edited on

2022-08-04

Licensed under

CC BY-NC-ND 4.0

# Programing  Cpp  OpenJudge  NOI  NOIP

Comments

Name
Mail
Site
None yet