当前位置:网站首页>打印菱形图案
打印菱形图案
2022-07-04 00:34:00 【CTGU-Yoghurt】
题目:
代码详解:
#include <stdio.h>
#include "math.h"
void fun(int i)
{
int m, n;
/**********Program**********/
for (n = i; abs(n) <= i; n--)//通过数字的递减和数字的绝对值来控制
{
for (m = 0; m <= abs(n); m++)//输出的空格数
{
printf(" ");
}
for (m = 0; m <= (i - abs(n))*2; m++)//输出的*数
{
printf("*");
}
printf("\n");
}
/********** End **********/
}
int main()
{
int n;
scanf("%d", &n);
fun(n);
}
PS:水博客。
边栏推荐
- [about text classification trick] things you don't know
- Research Report on the scale prediction of China's municipal engineering industry and the prospect of the 14th five year plan 2022-2028
- [complimentary ppt] kubemeet Chengdu review: make the delivery and management of cloud native applications easier!
- What is the Valentine's Day gift given by the operator to the product?
- Gossip about redis source code 78
- UTS | causal reasoning random intervention based on Reinforcement Learning
- Data mining vs Machine Learning: what is the difference between them? Which is more suitable for you to learn
- Make small tip
- Introduction to thread pool
- From functools import reduce -- see the use of reduce function from typical examples
猜你喜欢
![[Mongodb] 2. Use mongodb --------- use compass](/img/d5/0eb7dd4c407fbf2e9ba1b175f5424d.jpg)
[Mongodb] 2. Use mongodb --------- use compass

Recommendation of knowledge base management system

Yyds dry goods inventory three JS source code interpretation - getobjectbyproperty method

Analysis on the scale of China's smart health industry and prediction report on the investment trend of the 14th five year plan 2022-2028 Edition

Is it really possible that the monthly salary is 3K and the monthly salary is 15K?

NLP Chinese corpus project: large scale Chinese natural language processing corpus

Struct in linked list

Shell script three swordsman sed

STM32 key light

A method to solve Bert long text matching
随机推荐
Suggestions for improving code quality
STM32 GPIO CSDN creative punch in
Idea set class header comments
【leetcode】300. Longest increasing subsequence (dynamic programming, dichotomy)
It is forbidden to splice SQL in code
Eight year test old bird, some suggestions for 1-3 year programmers
Global and Chinese markets for coronary artery disease treatment devices 2022-2028: Research Report on technology, participants, trends, market size and share
Investment demand and income forecast report of China's building ceramics industry, 2022-2028
China standard gas market prospect investment and development feasibility study report 2022-2028
[error record] configure NDK header file path in Visual Studio (three header file paths of NDK | ASM header file path selection related to CPU architecture)
What is the potential of pocket network, which is favored by well-known investors?
Introducing Software Testing
Advanced C language - pointer 2 - knowledge points sorting
[software testing] you haven't mastered these real interview questions of big companies?
Global and Chinese market of breast cancer imaging 2022-2028: Research Report on technology, participants, trends, market size and share
Entropy and full connection layer
Global and Chinese market of underwater bags 2022-2028: Research Report on technology, participants, trends, market size and share
Gossip about redis source code 76
Report on prospects and future investment recommendations of China's assisted reproductive industry, 2022-2028 Edition
P1629 postman delivering letter