马上七夕了程序员如何给爱人一个浪漫表白?

Cpp代码如下:

#include <stdio.h>
#include <math.h>
#include <stdlib.h>

int main() {
    float a, x, y;

    system("cls");
    system("color 0C");

    for(y = 1.5; y >-1.5; y -= 0.1) {
        for(x = -1.5; x < 1.5; x += 0.05) {
            a = x * x + y * y - 1;
            if ((pow(a, 3.0) - pow(x, 2.0) * pow(y, 3.0)) <= 0.0)
                printf("*");
            else
                printf(" ");
        }
        printf("\n");
    }

    system("pause");
    exit(0);
}

编译后,把文件发给女朋友,她打开后,将会看到:

alt

浪漫不浪漫呢?哈哈~

全部评论

相关推荐

07-14 12:22
门头沟学院 Java
点赞 评论 收藏
分享
06-28 22:48
已编辑
广东金融学院 Java
小浪_Coding:学院本+这俩项目不是buff叠满了嘛
点赞 评论 收藏
分享
评论
点赞
1
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务