当前位置:网站首页>c语言打印心形
c语言打印心形
2022-06-11 08:37:00 【Jimmy_jimi】
目标:打印心形

分析:
先生成一个菱形,采用用线条分割图像的思想进一步处理。
结果产出:
#include <stdio.h>
#include <stdlib.h>
int main() {
for (int j = 1; j < 20; j++)
{
for (int i = 1; i < 20; i++)
{
if (i + j >= 11 && i + j <= 29 && (i + j) % 2 == 1 && i - j<11 && i - j>-11 && j > 6)
{
if (j < 10 && j+i<=19 && i - j >= 1) {
printf(" ");
}
else {
printf("*");
}
}
else
{
printf(" ");
}
}
printf("\n");
}
}
边栏推荐
- Oracle learning (I)
- 一些学习记录i=
- BFS on tree (tree breathing first search)
- 命名实体识别之CRF的实现方式
- 木板ISO 5660-1 热量释放速率摸底测试
- leetcode - 230. 二叉搜索树中第K小的元素
- Getting started with Zipkin
- (resolved) typeerror: meshgrid() got an unexpected keyword argument 'indexing‘
- SSM file upload and download
- MySQL advanced features, you can read more about it and meet the interview
猜你喜欢

Empty difference between postgrepsql and Oracle

用飞项进行目标管理,不做职场上的“无头苍蝇”

(resolved) the tqdm progress bar in the Jupiter notebook does not update and display in one line, but scrolls down to output

剑指 Offer 62. 圆圈中最后剩下的数字

经典图论,深度优先和广度优先,拓扑,Prim和Krukal,该来温习啦

Supplement 2: circle returning to origin

Uniapp plug-in development

Hibernate L2 cache

Implementation of CRF for named entity recognition

torch. roll
随机推荐
【Image Processing】空间域图像增强
Don't want the project out of control? You need to use project management tools
Not eligible for getting processed by all beanpostprocessors
Asynchronous notification mechanism of character device driver
B+超强树,带你知晓MySQL的底层是怎样的结构
MySQL & Oracle database capacity query
torch. unbind()
Using flying items to manage by objectives, not being a "headless fly" in the workplace
一些学习记录i=
(resolved) typeerror: meshgrid() got an unexpected keyword argument 'indexing‘
Qiao lerna: lerna auxiliary tool
SAP 物料主数据归档
ActiveMQ简单教程,适合初学者,学习笔记yyds
leetcode - 518. Change II
Type of SQL command (incomplete)
不想项目失控?你需要用对项目管理工具
B+ super tree helps you know the underlying structure of MySQL
驱动壳美国测试UL 2043 符合要求有哪些?
(resolved) the tqdm progress bar in the Jupiter notebook does not update and display in one line, but scrolls down to output
centos随笔03:centos8.2安装mysql