当前位置:网站首页>C language printing heart
C language printing heart
2022-06-11 08:55:00 【Jimmy_ jimi】
The goal is : Print hearts

analysis :
Sir, in a diamond shape , The idea of segmenting the image with lines is adopted for further processing .
Result output :
#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");
}
}
边栏推荐
- Intelligent control theory question bank
- TextView文本大小自动适配与TextView边距的去除
- Are the test methods of CMVSS TSD No. 302 and 49 CFR 571.302 the same
- Usage and difference between map and set in JS
- What are precompiled, compiled, assembled, linked, static and dynamic libraries
- (二)从架构设计角度分析AAC源码-我的LiveData
- [Clickhouse column] user initialization of new library role
- (一)aac开篇-核心组件原理之Lifecycle、LiveData、ViewModel与源码分析技巧(转载)
- How to apply for ASTM E108 flame retardant test for photovoltaic panels?
- What is the process of en 1101 flammability test for curtains?
猜你喜欢

leetcode - 460. LFU cache

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

Supplement 2: circle returning to origin

leetcode - 460. LFU 缓存

c语言打印心形

File system check of the root filesystem failed

你所不知道的console

leetcode - 230. The k-th smallest element in a binary search tree

AS 3744.1标准中提及ISO8191测试,两者测试一样吗?

Android interview transcript (carefully sorted out)
随机推荐
Create a nodejs based background service using express+mysql
MySQL & Oracle database capacity query
Are the test methods of CMVSS TSD No. 302 and 49 CFR 571.302 the same
Can not connect to local MySQL server through socket ‘/tmp/mysql. sock (2)‘
智能控制理论小题库
利用docker-compose搭建redis5集群
Wood board ISO 5660-1 heat release rate mapping test
剑指 Offer 10- II. 青蛙跳台阶问题
Cron expressions in scheduled tasks
Oracle learning (I)
leetcode - 460. LFU 缓存
Is it appropriate to apply silicone paint to American Standard UL 790 class a?
SQL basic query
(二)从架构设计角度分析AAC源码-我的LiveData
【C语言-数据存储】数据在内存中是怎样存储的?
剑指 Offer 62. 圆圈中最后剩下的数字
typescript高阶特性一 —— 合并类型(&)
Redis6 entry-level tutorial. There are integration cases. You can directly see the integration cases. It is easy to get started
Introduction to knowledge atlas -- yedda annotation
【clickhouse专栏】新建库角色用户初始化