当前位置:网站首页>打印菱形图案
打印菱形图案
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:水博客。
边栏推荐
- NLP pre training technology development
- I wrote a chat software with timeout connect function
- Global and Chinese markets for instant saliva testing devices 2022-2028: Research Report on technology, participants, trends, market size and share
- 【leetcode】300. Longest increasing subsequence (dynamic programming, dichotomy)
- What are the application fields of digital twins in industry?
- Is the account opening of Guoyuan securities really safe and reliable
- Development and application of fcitx functional plug-ins
- Smart fan system based on stm32f407
- Pair
- The upload experience version of uniapp wechat applet enters the blank page for the first time, and the page data can be seen only after it is refreshed again
猜你喜欢
Docking Alipay process [pay in person, QR code Payment]
China standard gas market prospect investment and development feasibility study report 2022-2028
Pytorch learning notes 5: model creation
What does redis do? Redis often practices grammar every day
ESP Arduino playing with peripherals (V) basic concept of interrupt and timer interrupt
Tencent interview: can you pour water?
Idea a method for starting multiple instances of a service
[2021]NeRF in the Wild: Neural Radiance Fields for Unconstrained Photo Collections
[about text classification trick] things you don't know
What is the GPM scheduler for go?
随机推荐
Solution to the impact of Remote Code Execution Vulnerability of log4j2 component on December 9, 2021
[software testing] you haven't mastered these real interview questions of big companies?
Global and Chinese markets for blood and liquid heating devices 2022-2028: Research Report on technology, participants, trends, market size and share
Gossip about redis source code 75
Tencent interview: can you pour water?
Data storage - interview questions
【leetcode】374. Guess the size of the number
Collation of the most complete Chinese naturallanguageprocessing data sets, platforms and tools
Vscode regular match replace console log(.*)
It is worthy of "Alibaba internal software test interview notes" from beginning to end, all of which are essence
Why use get/set instead of exposing properties
Pair
Zipper table in data warehouse (compressed storage)
ESP Arduino playing with peripherals (V) basic concept of interrupt and timer interrupt
Yyds dry goods inventory three JS source code interpretation - getobjectbyproperty method
STM32 key light
Double efficiency. Six easy-to-use pychar plug-ins are recommended
NLP Chinese corpus project: large scale Chinese natural language processing corpus
(Introduction to database system | Wang Shan) Chapter V database integrity: Exercises
Social network analysis -social network analysis