当前位置:网站首页>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 .
边栏推荐
- Similarities and differences of text similarity between Jaccard and cosine
- P3371 [template] single source shortest path (weakened version)
- Is the account opening of Guoyuan securities really safe and reliable
- Employees' turnover intention is under the control of the company. After the dispute, the monitoring system developer quietly removed the relevant services
- 功能:求出菲波那契数列的前一项与后一项之比的极限的 近似值。例如:当误差为0.0001时,函数值为0.618056。
- NLP pre training technology development
- [PHP basics] session basic knowledge, application case code and attack and defense
- MySQL winter vacation self-study 2022 12 (2)
- Test the influence of influent swacth on the electromagnetic coil of quartz meter
- UTS | causal reasoning random intervention based on Reinforcement Learning
猜你喜欢

Collation of the most complete Chinese naturallanguageprocessing data sets, platforms and tools

What is the future of software testing industry? Listen to the test veterans' answers

Sequence list and linked list

Release and visualization of related data

Unity elementary case notes of angry birds Siki college 1-6

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

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

手机异步发送短信验证码解决方案-Celery+redis

It is worthy of "Alibaba internal software test interview notes" from beginning to end, all of which are essence

Self study software testing. To what extent can you go out and find a job?
随机推荐
功能:将主函数中输入的字符串反序存放。例如:输入字符串“abcdefg”,则应输出“gfedcba”。
swagger中响应参数为Boolean或是integer如何设置响应描述信息
UTS | causal reasoning random intervention based on Reinforcement Learning
How to trade spot gold safely?
A-Frame虚拟现实开发入门
How to use AHAS to ensure the stability of Web services?
MySQL 8.0.12 error: error 2013 (HY000): lost connection to MySQL server during query
Is the account opening of Guoyuan securities really safe and reliable
Global and Chinese market of underwater bags 2022-2028: Research Report on technology, participants, trends, market size and share
国元证券开户是真的安全可靠吗
Pytest unit test framework: simple and easy to use parameterization and multiple operation modes
Stock price forecast
Introduction to thread pool
Pair
The difference between fetchtype lazy and eagle in JPA
[leetcode] interview question 17.08 Circus tower
AI Challenger 2018 text mining competition related solutions and code summary
HR disgusted interview behavior
(Video + graphics and text) introduction to machine learning series - Chapter 4 naive Bayes
Release and visualization of related data