当前位置:网站首页>打印菱形图案
打印菱形图案
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:水博客。
边栏推荐
- Tencent interview: can you find the number of 1 in binary?
- Interview script of Software Test Engineer
- A method to solve Bert long text matching
- Att & CK actual combat series - red team actual combat - V
- Correlation analysis summary
- What insurance products should be bought for the elderly?
- It is the most difficult to teach AI to play iron fist frame by frame. Now arcade game lovers have something
- 2022 Software Test Engineer skill list, please check
- Software testers, how can you quickly improve your testing skills? Ten minutes to teach you
- The frost peel off the purple dragon scale, and the xiariba people will talk about database SQL optimization and the principle of indexing (primary / secondary / clustered / non clustered)
猜你喜欢
![Docking Alipay process [pay in person, QR code Payment]](/img/30/665580241020ee3adb872e725f0624.jpg)
Docking Alipay process [pay in person, QR code Payment]

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

Cannot build artifact 'test Web: War expanded' because it is included into a circular depend solution

Alibaba test engineer with an annual salary of 500000 shares notes: a complete set of written tests of software testing

Idea a method for starting multiple instances of a service
![[PHP basics] cookie basics, application case code and attack and defense](/img/7c/551b79fd5dd8a411de85c800c3a034.jpg)
[PHP basics] cookie basics, application case code and attack and defense

STM32 key light
![[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)](/img/44/aa4963d07d046deb2bc76eb59f8ff7.jpg)
[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)

Bodong medical sprint Hong Kong stocks: a 9-month loss of 200million Hillhouse and Philips are shareholders
![[2021]NeRF in the Wild: Neural Radiance Fields for Unconstrained Photo Collections](/img/c6/3dc7d01600f6713afdbb4cf3df5238.jpg)
[2021]NeRF in the Wild: Neural Radiance Fields for Unconstrained Photo Collections
随机推荐
Unity elementary case notes of angry birds Siki college 1-6
Several ways to set up a blog locally [attach relevant software download links]
Att & CK actual combat series - red team actual combat - V
Generic tips
A dichotomy of Valentine's Day
Advanced C language - pointer 2 - knowledge points sorting
What is the potential of pocket network, which is favored by well-known investors?
[Mongodb] 2. Use mongodb --------- use compass
Detailed explanation of the relationship between Zhongtai, wechat and DDD
Makefile judge custom variables
Similarities and differences of text similarity between Jaccard and cosine
[software testing] you haven't mastered these real interview questions of big companies?
What is the Valentine's Day gift given by the operator to the product?
Suggestions for improving code quality
On the day when 28K joined Huawei testing post, I cried: everything I have done in these five months is worth it
Global and Chinese markets for instant saliva testing devices 2022-2028: Research Report on technology, participants, trends, market size and share
After the Lunar New Year and a half
The frost peel off the purple dragon scale, and the xiariba people will talk about database SQL optimization and the principle of indexing (primary / secondary / clustered / non clustered)
[PHP basics] session basic knowledge, application case code and attack and defense
How to be a professional software testing engineer? Listen to the byte five year old test