当前位置:网站首页>【C 练习】箭形图案
【C 练习】箭形图案
2022-07-19 00:10:00 【Domeecky】
例:
可以将图案分为两部分打印,并将两个空格视为一组。
int num = 0;
scanf("%d", &num);
//上半部分
for (int i = 0; i < num; i++)
{
for (int j = 0; j < num - i; j++)
printf(" ");//两个空格
for (int j = 0; j < i + 1; j++)
printf("*");
printf("\n");
}
//下半部分
for (int i = 0; i < num + 1; i++)
{
for (int j = 0; j < i; j++)
printf(" ");//两个空格
for (int j = 0; j < num - i + 1; j++)
printf("*");
printf("\n");
}
边栏推荐
- B树-删除
- QQ群无法下载视频和图片解决方案
- (2) Fastai 2019 part2 key refining
- [OC study notes]gcd review
- Review of leetcode question brushing (question No.: 94, 17, interview questions 17, 102, 215, 1, 21)
- Online XML to JSON tool
- 买股票哪个证券公司最好?哪个券商平台最安全
- LeetCode-补充题6-手撕堆排序
- Kotlin processing list set data
- 企业内容管理(ECM)与文档管理的区别及其优势
猜你喜欢
【Jailhouse 文章】Specific Electronic Platform to Test the Influence of Hypervisors on the Performance..
Zabbix5.0 configuring enterprise wechat alarm
7. [WebGIS practice] special topic - API key
[OC study notes]gcd review
(2) Fastai 2019 part2 key refining
Leetcode- supplementary question 6 - sorting by hand
FAST-LIO2代码解析(一)
LeetCode-394-字符串解码
夏日不眠夜
Flutter启动流程(Isolate机制+创建流程+线程练习)
随机推荐
【Web3 系列开发教程——创建你的第一个 NFT(3)】开始创建 NFT
7、【WebGIS实战】专题篇——API key
VIM editor introduction, 3 working modes
使用pytorch自己构建网络模型实战
7. [WebGIS practice] special topic - API key
「接口測試入門課」打卡學習 day03:理解接口測試的關鍵邏輯
Build your own network model with pytorch
阻碍NFT进一步发展的绊脚石都有哪些?从6个方面切入分析
Normalestimation normal vector estimation theory and code -- PCL source code Notes
有一万元做什么创业好呢?自媒体行不行?
有奖调研 | 让虚拟照入现实的完美AR开发平台长什么样?
VIM basic operation commands
UML class diagram relationships (generalization, inheritance, implementation, dependency, association, aggregation, composition)
Shell query Prometheus data
Selenium processing verification code
【自学习】- 怎么让对话机器人越来越强?
Introduction and use of finalshell
「分享」DevExpress WPF v22.1最新版本系统环境配置要求
day03_2_流程控制
夏日不眠夜