OpenJudge 09:Character diamond

Description

Given a character, use it to construct a diagonal length of 5 characters, and tilt the diamond shape.

Input

There is only one line input, including one character.

OUTPUT

The diamond shape composed of this character.

Input Sample

*

OUTPUT SAMPLE

   *
  ***
 *****
  ***
   *

idea

Use Cout or Printf to output.

Answer

CPP

include

using namespace std;
int Main ()
{{
char a;
cin >> a;
COUT << "" << A << Endl;
cout << "" << a << a << Endl;
COUT << a << a << a <<<<endl;
cout << "" << a << a << Endl;
COUT << "" << A << Endl;
Return 0;
}

Result

Used Memory: 200KB
Run time: 10ms
Language: G ++
Submit time: 2019-03-24 09:20:31

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

OpenJudge 09:Character diamond

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

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