【C语言】用C语言输出一个吃豆人

大圆盘减去扇形和小圆盘:

#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 */
}

posted @ 2019-12-17 15:32  木子欢儿  阅读(828)  评论(0编辑  收藏  举报