• 欢迎访问C语言网www.dotcpp.com 比赛栏每月有奖月赛!举办比赛联系QQ:2045302297
  • 问题反馈、粉丝交流 QQ群327452739 蓝桥杯训练群:113766799 申请群时请备注排名里的昵称
  • C语言研究中心 为您提供有图、有料、解渴的C语言专题! 欢迎讨论!

用C语言实现心形表白程序[酷炫动态版]

项目源码 CTO 278213次浏览 69个评论

前几天给大家放一个C语言实现心形表白功能的程序,许多小白觉得有意思,今天给大家再放一个更炫酷的表白程序,有需要的童鞋拿去吧~

先看看效果图吧:

用C语言实现心形表白程序[酷炫动态版]

 

因为是动图,所以只能象征性给大家截图啦~

用C语言实现心形表白程序[酷炫动态版]

 

怎么样?童鞋们,好看吗?实际运行起来更炫哦~ 想表白的小伙伴拿去吧~ 不谢不谢~ 咩哈哈哈!

 

上源码!

 

#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#define I 20
#define R 340
int main()
{
int i,j,e;
int a;
long time;
system("title c语言研究中心www.dotcpp.com");
for(i=1,a=I;i<I/2;i++,a--)
{
for(j=(int) ( I-sqrt(I*I-(a-i)*(a-i)) );j>0;j--)
printf(" ");
for(e=1;e<=2*sqrt(I*I-(a-i)*(a-i));e++)
printf("\3");
for(j=(int)
( 2*( I-sqrt(I*I-(a-i)*(a-i)) ) );j>0;j--)
printf(" ");
for(e=1;e<=2*sqrt(I*I-(a-i)*(a-i));e++)
printf("\3");
printf("\n"); }
for(i=1;i<80;i++)
{
if(i==25)
{
printf(" 我爱www.dotcpp.com ");
i+=30;
}
printf("\3");
}
printf("\n");
for(i=1;i<=R/2;i++)
{
if(i%2||i%3)
continue;
for(j=(int) ( R-sqrt(R*R-i*i) );j>0;j--)
printf(" ");
for(e=1;e<=2*( sqrt(R*R-i*i) - (R-2*I) );e++)
printf("\3");
printf("\n");
}

for(; ; )
{
system("color a");
for(time=0;time<99999999;time++); system("color b");
for(time=0;time<99999999;time++); system("color c");
for(time=0;time<99999999;time++); system("color d");
for(time=0;time<99999999;time++); system("color e");
for(time=0;time<99999999;time++); system("color f");
for(time=0;time<99999999;time++);
system("color 0"); for(time=0;time<99999999;time++);
system("color 1"); for(time=0;time<99999999;time++);
system("color 2"); for(time=0;time<99999999;time++);
system("color 3"); for(time=0;time<99999999;time++);
system("color 4");
for(time=0;time<99999999;time++); system("color 5");
for(time=0;time<99999999;time++); system("color 6");
for(time=0;time<99999999;time++); system("color 7");
for(time=0;time<99999999;time++); system("color 8");
for(time=0;time<99999999;time++); system("color 9");
for(time=0;time<99999999;time++); system("color ab");
for(time=0;time<99999999;time++); system("color ac");
for(time=0;time<99999999;time++); system("color ad");
for(time=0;time<99999999;time++); system("color ae");
for(time=0;time<99999999;time++); system("color af");
for(time=0;time<99999999;time++); }
return 0;
}

 

C语言研究中心www.dotcpp.com

C语言网提供「C语言、C++、算法竞赛」在线课程,全部由资深研发工程师或ACM金牌大佬亲授课,更科学、全面的课程体系,以在线视频+在线评测的学习模式学习,学练同步,拒绝理论派,真正学会编程!还有奖学金等增值福利等你!

C语言网, 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明用C语言实现心形表白程序[酷炫动态版]
喜欢 (1565)
[jinyangH@aliyun.com]
分享 (0)
发表我的评论
取消评论
表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
(69)个小伙伴在吐槽
  1. 哈哈哈! 一言不合就上代码!
    CTO2016-10-26 22:07 回复
    • 这个做出来停不下来,也不是心形,小图案也不是心形 :cry:
      Selina2018-11-12 20:03 回复
      • 为什么我的不是心形 而是小方块
        ahjol2019-03-17 18:29 回复
    • 可以帮帮我吗
      你好2019-03-11 18:56 回复
  2. 不错
    弦月2016-11-17 20:25 回复
    • 我怎么不会啊 里面程序里有个表情 不让编译
      静悦梦2016-11-29 19:19 回复
      • 已经修复啦`
        CTO2017-02-23 11:01 回复
        • 可是sqrt函数是double型呀,这个前面是int类型,会出错
          阡陌陌2018-08-01 17:00 回复
          • 遇到了同样的问题
            嘿嘿2018-11-14 11:04
        • 怎么修复的
          吴sir2018-12-09 20:06 回复
  3. 组建没有语病,怎么编译就出了题了
    MJ2017-05-12 11:48 回复
  4. 出来的图案不是心形
    Alsion2017-05-21 09:36 回复
    • 我运行出来也不是心形
      北梦南巷2018-03-08 19:44 回复
    • 我用CB打出来的图案也不是心形
      帅帅杨2018-03-16 00:02 回复
  5. 怎么出来不是心形
    陌子辰2017-06-29 12:58 回复
  6. 出来的只有一个角 整体大小的修改在那里
    郭嘉2017-07-23 20:00 回复
    • 你改对了吗 我也是这个问题
      hhh2017-11-15 18:20 回复
      • 我的心只有一半你说气不气人
        2018-01-04 14:48 回复
        • 因为你不够真心吧!哈哈?,检查一下#define R 340 这里写成30会半边心哦
          天使girl叶子2018-05-17 17:38 回复
  7. 编译怎么出错
    麻麻烦烦2017-07-26 19:53 回复
  8. 为嘛图形不是心形啊
    2017-08-04 22:41 回复
    • 你在41行的时候sqrt函数加入double的时候出了问题
      波波2018-08-18 10:32 回复
  9. 是使用VC++6.0吗
    子书卉月2017-09-08 14:48 回复
  10. 是用的DEVc++吗?我编译出来乱码。。没有心
    polslon2017-09-17 11:14 回复
    • 我的也是诶,没有心心
      麋鹿2019-05-03 23:29 回复
  11. 我的心是歪的~
    cool2017-10-09 15:18 回复
    • 我的也是歪的
      zj2017-12-27 17:30 回复
  12. 能说为什么图形不是心形的吗
    凯诺2017-10-12 00:24 回复
  13. 为什么我的都出不来
    漾杨恙2017-10-31 17:26 回复
  14. 我的心也是歪的
    又是空白2017-11-08 11:49 回复
  15. 我为什么只有半个
    帅帅锅2017-11-16 14:23 回复
    • 我也是啊啊啊啊啊
      2018-01-04 14:48 回复
    • 因为你不够真心吧!哈哈?,检查一下#define R 340 这里写成30会半边心哦
      天使girl叶子2018-05-17 17:39 回复
      • 运行的时候好好看,还会换颜色
        hvchv2019-05-20 18:41 回复
  16. 有没有ns图啊求一张
    吴康佳2017-12-11 11:51 回复
  17. 厉害
    www可可2017-12-11 11:54 回复
  18. 我想问问devc++能运行吗
    wen23332017-12-20 15:00 回复
  19. 有一个错误,怎么回事啊
    162018-03-15 14:38 回复
  20. printf("\3"); 这个语句是什么意思呀?希望各位大佬指教
    帅帅杨2018-03-16 00:37 回复
    • \3是代表ASCII码值为3点字符
      HugginBear2018-03-30 11:54 回复
    • “\3”就是❤心
      天使girl叶子2018-05-17 17:41 回复
  21. 有没有懂的大神上个注释啊,完全看不懂
    大一小白2018-03-19 10:16 回复
  22. 用c++,组建的时候出错了哎
    长风故里时2018-03-30 20:54 回复
  23. 怎么显示sqrt是错误的??
    慎独2018-05-07 20:26 回复
    • 加头文件include<math.h>
      aaa,救救我2021-07-29 20:21 回复
  24. 你的代码运行出来的心形不完整
    妍小姐2018-07-23 22:21 回复
  25. 这个用什么东西运行啊
    辉少网络2018-07-28 11:13 回复
  26. 可是sqrt函数是double型呀,这个前面是int类型,会出错
    阡陌陌2018-08-01 17:00 回复
    • 怎么改?
      风流邪帝2018-10-28 13:18 回复
  27. 我的运行不得,它说找不到颜色
    巴扎黑2018-10-23 16:47 回复
  28. 为什么我输出之后一半是爱心,另外一半是一横排的小方框
    mlw2019-03-01 12:32 回复
  29. 喜欢
    一点23分2019-03-11 13:36 回复
  30. 你们有全屏变绿的那个现象吗,怎么去掉啊,小图案怎么改为心形呀
    你好2019-03-11 18:53 回复
  31. 为什么 最大化后,爱心停留在了左上角?
    梦中小白2019-04-13 15:16 回复
  32. 谁能给我解释一遍这个程序,做实验报告 有偿
    暮色浓妆 却微凉。2019-06-11 23:38 回复
  33. 我想要保存GIF图怎么搞,大佬求教
    狗子2019-08-01 11:06 回复
  34. html,vbs,bat,都打不开
    火星爱上旅游2019-09-12 00:50 回复
  35. 为什么心只有一半
    墨寒2019-10-05 22:50 回复
  36. 没实力还嚣张。根本就不行 不是原来的
    墨寒2019-10-05 22:56 回复
  37. 小图案为啥不是心形啊
    2019-10-19 14:49 回复
    • 辣鸡楼主
      哩哩2019-10-21 15:37 回复
  38. 运行错误,
    哩哩2019-10-21 15:24 回复
  39. 在第18条
    哩哩2019-10-21 15:24 回复
  40. 18,19都显示 18:expected before for 19:expected before token
    哩哩2019-10-21 15:26 回复
  41. #include #include #include #define I 20 #define R 340 int main() { int i,j,e; int a; long time; system("title 爱的表达式"); for(i=1,a=I;i0;j--) printf(" "); for(e=1;e0;j--) printf(" "); for(e=1;e<=2*sqrt(I*I-(a-i)*(a-i));e++) printf("\3"); printf("\n"); } for(i=1;i<98;i++) { if(i==35) { printf(" 我爱你1314 "); i+=30; } printf("\3"); } printf("\n"); for(i=1;i0;j--) printf(" "); for(e=1;e<=2*( sqrt(R*R-i*i) - (R-2*I) );e++) printf("\3"); printf("\n"); } for(; ; ) { system("color a"); for(time=0;time<99999999;time++); system("color b"); for(time=0;time<99999999;time++); system("color c"); for(time=0;time<99999999;time++); system("color d"); for(time=0;time<99999999;time++); system("color e"); for(time=0;time<99999999;time++); system("color f"); for(time=0;time<99999999;time++); system("color 0"); for(time=0;time<99999999;time++); system("color 1"); for(time=0;time<99999999;time++); system("color 2"); for(time=0;time<99999999;time++); system("color 3"); for(time=0;time<99999999;time++); system("color 4"); for(time=0;time<99999999;time++); system("color 5"); for(time=0;time<99999999;time++); system("color 6"); for(time=0;time<99999999;time++); system("color 7"); for(time=0;time<99999999;time++); system("color 8"); for(time=0;time<99999999;time++); system("color 9"); for(time=0;time<99999999;time++); system("color ab"); for(time=0;time<99999999;time++); system("color ac"); for(time=0;time<99999999;time++); system("color ad"); for(time=0;time<99999999;time++); system("color ae"); for(time=0;time<99999999;time++); system("color af"); for(time=0;time<99999999;time++); } return 0; }
    哈喽2019-12-04 14:44 回复
  42. 用我这个,我在原著的基础上修改了一下
    哈喽2019-12-04 14:45 回复
  43. 用我这个,我在原著的基础上修改了一下 #include #include #include #define I 20 #define R 340 int main() { int i,j,e; int a; long time; system("title 爱的表达式"); for(i=1,a=I;i0;j--) printf(" "); for(e=1;e0;j--) printf(" "); for(e=1;e<=2*sqrt(I*I-(a-i)*(a-i));e++) printf("\3"); printf("\n"); } for(i=1;i<98;i++) { if(i==35) { printf(" 我爱你1314 "); i+=30; } printf("\3"); } printf("\n"); for(i=1;i0;j--) printf(" "); for(e=1;e<=2*( sqrt(R*R-i*i) - (R-2*I) );e++) printf("\3"); printf("\n"); } for(; ; ) { system("color a"); for(time=0;time<99999999;time++); system("color b"); for(time=0;time<99999999;time++); system("color c"); for(time=0;time<99999999;time++); system("color d"); for(time=0;time<99999999;time++); system("color e"); for(time=0;time<99999999;time++); system("color f"); for(time=0;time<99999999;time++); system("color 0"); for(time=0;time<99999999;time++); system("color 1"); for(time=0;time<99999999;time++); system("color 2"); for(time=0;time<99999999;time++); system("color 3"); for(time=0;time<99999999;time++); system("color 4"); for(time=0;time<99999999;time++); system("color 5"); for(time=0;time<99999999;time++); system("color 6"); for(time=0;time<99999999;time++); system("color 7"); for(time=0;time<99999999;time++); system("color 8"); for(time=0;time<99999999;time++); system("color 9"); for(time=0;time<99999999;time++); system("color ab"); for(time=0;time<99999999;time++); system("color ac"); for(time=0;time<99999999;time++); system("color ad"); for(time=0;time<99999999;time++); system("color ae"); for(time=0;time<99999999;time++); system("color af"); for(time=0;time<99999999;time++); } return 0; }
    哈喽2019-12-04 14:46 回复
  44. 运行出来的不是心形,而是小方块
    张小中2022-02-08 18:09 回复
    • 那是因为ASCII码里面 3 就是一个字符小爱心 ,然后你打错了
      阿离2022-09-07 09:56 回复