#include <math.h>
#include <stdio.h>
int main() {
double x, y;
for (y = 1; y >= -1; y -= 0.05, putchar('\n'))
for (x = -1; x <= 1; x += 0.025)
putchar(" *"[
x * x + y * y < 1 &&
/* disk */
fabs(atan2(y, x)) > 0.5 &&
/* mouth */
x * x + pow(y - 0.5, 2) > 0.02]);
/* eye */
}
吃豆人模型
最新推荐文章于 2026-01-07 11:46:22 发布
本文通过C/C++代码展示了如何使用math.h和stdio.h库,通过迭代计算和条件判断,生成包含星形、眼睛和嘴巴形状的几何图案,探索了计算机图形的基本原理。

1712

被折叠的 条评论
为什么被折叠?



