当前位置:网站首页>Electronic Society C language level 1 28, character diamond
Electronic Society C language level 1 28, character diamond
2022-06-25 05:08:00 【dllglvzhenfeng】
Electronics Association C Language 1 level 28 、 Character diamond
OpenJudge - 09: Character diamond
C The language code :
/*
Electronics Association C Language 1 level 28 、 Character diamond
http://noi.openjudge.cn/ch0101/09/
Given a character , Use it to construct a diagonal length 5 Characters , A diamond placed obliquely .
Input : There is only one line of input , Contains one character .
Output
This character forms a diamond .
The sample input
*
Sample output
*
***
*****
***
*
*/
#include <stdio.h>
#include <stdlib.h>
int main()
{
char ch;
// Given a character ,
scanf("%c",&ch);
// Use it to construct a diagonal length 5 Characters , A diamond placed obliquely .
printf(" %c\n",ch);
printf(" %c%c%c\n",ch,ch,ch);
printf("%c%c%c%c%c\n",ch,ch,ch,ch,ch);
printf(" %c%c%c\n",ch,ch,ch);
printf(" %c\n",ch);
return 0;
}C++ Code :
/*
Electronics Association C Language 1 level 28 、 Character diamond
http://noi.openjudge.cn/ch0101/09/
Given a character , Use it to construct a diagonal length 5 Characters , A diamond placed obliquely .
Input : There is only one line of input , Contains one character .
Output
This character forms a diamond .
The sample input
*
Sample output
*
***
*****
***
*
*/
#include<iostream> // Use cin,cout, Must be invoked iostream library
using namespace std;
int main()
{
char a; // Defining character variables ,
cin>>a; // Enter a given character
cout<<" "<<a<<endl; // Output 1 Characters , First, the output 2 A space
cout<<" "<<a<<a<<a<<endl; // Output 3 Characters , First, the output 1 A space
cout<<a<<a<<a<<a<<a<<endl; // Output 5 Characters
cout<<" "<<a<<a<<a<<endl; // Output 3 Characters , First, the output 1 A space
cout<<" "<<a<<endl; // Output 1 Characters , First, the output 2 A space
return 0; // End procedure
}python3 Code :
a = input()
print(' '+a+' ')
print(' '+a+a+a+' ')
print(a+a+a+a+a)
print(' '+a+a+a+' ')
print(' '+a+' ')边栏推荐
- 电子协会 C语言 1级 28 、字符菱形
- Opensea PHP development kit
- How micro engine uploads remote attachments
- 固態硬盤開盤數據恢複的方法
- How to install the blue lake plug-in to support Photoshop CC 2017
- February 19 CTF exercise
- Abuse unlimited authorization -- is your address safe?
- Eyeshot Ultimate 2022 Crack By Xacker
- Using JS to realize the sidebar of life information network
- SQL lab range explanation
猜你喜欢

buuctf(pwn)

Flex flexible layout for mobile terminal page production
![[relax's law of life lying on the square] those poisonous chicken soup that seem to be too light and too heavy, but think carefully and fear](/img/12/d41f8d5abcb61d2632a8b117bf1604.jpg)
[relax's law of life lying on the square] those poisonous chicken soup that seem to be too light and too heavy, but think carefully and fear

Route parameters to jump to the page and transfer parameters -- > hidden parameter list

Deeply understand the characteristics of standard flow and off standard elements

《QDebug 2022年6月》

Use serialize in egg to read and write split tables

Array: force deduction dichotomy

EL & JSTL (XIII)

XSS (cross site script attack) summary (II)
随机推荐
ThinkPHP 5 log management
Integrate CDN to create the ultimate service experience for customers!
Read the general components of antd source code
ORA-00800: soft external error
parallel recovery slave next change & parallel recovery push change
A brief talk on media inquiry
How to install the blue lake plug-in to support Photoshop CC 2017
Laravel Vonage SMS sending
epplus复制模板后打印区域变小的问题
Go deep into the working principle of browser and JS engine (V8 engine as an example)
For in JS Of and for in
台式电脑连不上wifi怎么办
Get to know the drawing component of flutter - custompaint
Qdebug June 2022
Method of opening data recovery of solid state disk
投资理财产品的年限要如何选?
渗透测试-目录遍历漏洞
Introduction to the hardest core PWN in the whole network_ Graphic analysis
Characteristics of ES6 arrow function
cuda编译报错