如何用C语言编写一个爱心
时间: 2023-05-14 18:06:42 浏览: 153
用C语言编写爱心
以下是一个简单的 C 语言程序,可以在控制台输出一个爱心:
```c
#include <stdio.h>
int main() {
printf(" ♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥\n");
printf(" ♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥\n");
printf("♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥\n");
printf("♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥\n");
printf("♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥\n");
printf(" ♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥\n");
printf(" ♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥\n");
return 0;
}
```
这个程序使用了控制台输出,通过打印一些字符来形成一个爱心的图案。
阅读全文