当前位置:网站首页>Print diamond pattern
Print diamond pattern
2022-07-04 00:41:00 【CTGU-Yoghurt】
subject :
Code details :
#include <stdio.h>
#include "math.h"
void fun(int i)
{
int m, n;
/**********Program**********/
for (n = i; abs(n) <= i; n--)// Control by decreasing the number and the absolute value of the number
{
for (m = 0; m <= abs(n); m++)// Number of spaces output
{
printf(" ");
}
for (m = 0; m <= (i - abs(n))*2; m++)// Output * Count
{
printf("*");
}
printf("\n");
}
/********** End **********/
}
int main()
{
int n;
scanf("%d", &n);
fun(n);
}
PS: Water blog .
边栏推荐
- [2021]NeRF in the Wild: Neural Radiance Fields for Unconstrained Photo Collections
- 数据库表外键的设计
- (Video + graphics and text) introduction to machine learning series - Chapter 4 naive Bayes
- [software testing] you haven't mastered these real interview questions of big companies?
- Eight year test old bird, some suggestions for 1-3 year programmers
- 【.NET+MQTT】.NET6 环境下实现MQTT通信,以及服务端、客户端的双边消息订阅与发布的代码演示
- Is the securities account opened by Caicai for individuals safe? Is there a routine
- Reading notes on how programs run
- Makefile judge custom variables
- Struct in linked list
猜你喜欢

Sequence list and linked list

Qtcharts notes (V) scatter diagram qscatterseries

机器学习基础:用 Lasso 做特征选择

What is the GPM scheduler for go?
![[common error] custom IP instantiation error](/img/de/d3f90cd224274d87fcf153bb9244d7.jpg)
[common error] custom IP instantiation error

On the day when 28K joined Huawei testing post, I cried: everything I have done in these five months is worth it

功能:求5行5列矩阵的主、副对角线上元素之和。注意, 两条对角线相交的元素只加一次。例如:主函数中给出的矩阵的两条对角线的和为45。

Pytest unit test framework: simple and easy to use parameterization and multiple operation modes

Shell script three swordsman sed

MySQL 8.0.12 error: error 2013 (HY000): lost connection to MySQL server during query
随机推荐
For loop
[leetcode] interview question 17.08 Circus tower
Sequence list and linked list
URL (data:image/png; Base64, ivborw0k... Use case
Reading notes on how programs run
Test the influence of influent swacth on the electromagnetic coil of quartz meter
A-Frame虚拟现实开发入门
Wechat official account and synchronization assistant
It is worthy of "Alibaba internal software test interview notes" from beginning to end, all of which are essence
[cloud native topic -48]:kubesphere cloud Governance - operation - overview of multi tenant concept
Struct in linked list
[software testing] you haven't mastered these real interview questions of big companies?
老姜的特点
Future源码一观-JUC系列
BBS forum recommendation
Regular expressions and text processors for shell programming
功能:求出菲波那契数列的前一项与后一项之比的极限的 近似值。例如:当误差为0.0001时,函数值为0.618056。
P3371 [template] single source shortest path (weakened version)
What is regression testing? Talk about regression testing in the eyes of Ali Test Engineers
leetcode 121 Best Time to Buy and Sell Stock 买卖股票的最佳时机(简单)