windows iframe boost cmd primefaces architecture vue案例 vue绑定事件 cpm计算 ab软启动器 oracle给表增加字段 wps文件修复工具下载 python连接mysql python运算符优先级 python正则表达 python变量定义 python数字类型 javafile java实现接口 java编程学习 javase教程 java的数据类型 java中tostring jdbc连接mysql java如何使用 java判断 linux系统安装教程图解 pyh c语言表白代码 pr缩放 复制到剪贴板 dll下载 彩虹岛小草黑暗之矛 视频加字幕软件 页面刷新 苹果双微信 3d看图软件 idea导出jar包 ppt格式刷怎么用 ug拔模
当前位置: 首页 > 学习教程  > 编程学习

c语言心形告白代码实现

2021/1/9 1:55:32 文章标签: c语言表白

c语言心形告白代码实现 1.彩色告白 includeincludeincludeincludedefine U 0.1 define V 0.053 void SetColor(unsigned short ForeColor,unsigned short BackGroundColor){HANDLE hConGetStdHandle(STDOUTPUTHANDLE);SetConsoleTextAttribute(hCon,(ForeColor%16)|(BackGr…

c语言心形告白代码实现

1.彩色告白

include

include

include

include

define U 0.1

define V 0.053

void SetColor(unsigned short ForeColor,unsigned short BackGroundColor)
{
HANDLE hCon=GetStdHandle(STDOUTPUTHANDLE);
SetConsoleTextAttribute(hCon,(ForeColor%16)|(BackGroundColor%16*16));
}
int main()
{
int i,s=0,t,a=10,b=11,c=12,d=13,e=14;
int z[] = {32,32,206,210,207,178,187,182,196,227,33,32,32};
float x,y;
srand(time(NULL));
for(y=1.3;y>=-1.1;y-=U)
{
for(x=-2;x<1.4;x+=V)
{
if((((xx+yy-1)(xx+yy-1)(xx+yy-1)-xxyyy)<=0))
{
if(y>=1.3-10U||y<=1.3-11U)
{
s++;
if(s%4==1){SetColor(a,0);printf("l");}
if(s%4==2){SetColor(e,0);printf("o");}
if(s%4==3){SetColor(c,0);printf("v");}
if(s%4==0){SetColor(d,0);printf("e");}
}
else
{
for(i = 0;i < 42;i++)
{
if(i<=14||i>=28)
{
s++;
if(s%4==1){SetColor(a,0);printf("l");}
if(s%4==2){SetColor(e,0);printf("o");}
if(s%4==3){SetColor(c,0);printf("v");}
if(s%4==0){SetColor(d,0);printf("e");}
}
else
{
SetColor(b,0);
printf("%c", z[i-15]);
Sleep(50);
}
}
break;
}
}
else
printf(" ");
Sleep(1);
}
printf("n");
}
printf("按任意键继续!");
getchar();
while(1)
{
system("cls");
t=a;a=b;b=c;c=d;d=e;e=t;
for(y=1.3;y>=-1.1;y-=U)
{
for(x=-2;x<1.4;x+=V)
{
if((((xx+yy-1)(xx+yy-1)(xx+yy-1)-xxyyy)<=0))
{
if(y>=1.3-10U||y<=1.3-11U)
{
s++;
if(s%4==1){SetColor(a,0);printf("l");}
if(s%4==2){SetColor(b,0);printf("o");}
if(s%4==3){SetColor(c,0);printf("v");}
if(s%4==0){SetColor(d,0);printf("e");}
}
else
{
for(i = 0;i < 42;i++)
{
if(i<=14||i>=28)
{
s++;
if(s%4==1){SetColor(a,0);printf("l");}
if(s%4==2){SetColor(b,0);printf("o");}
if(s%4==3){SetColor(c,0);printf("v");}
if(s%4==0){SetColor(d,0);printf("e");}
}
else
{
SetColor(e,0);
printf("%c", z[i-15]);
}
}
break;
}
}
else
printf(" ");
}
printf("n");
}
Sleep(1000);
system("cls");

    }  
}  

2.简单心形 #include

include

int main()
{
float y, x, a;
for (y = 1.5f;y > -1.5f;y -= 0.1f)
{
for (x = -1.5f;x < 1.5f;x += 0.05f)
{
a = xx + yy - 1;
putchar(aaa - xxyyy <= 0.0f ? '*' : ' ');
}
putchar('n');
}
return 0;
}

3.花纹心形

查看原文 https://www.cppentry.com/bencandy.php?fid=45&id=169184

编程开发资料 https://www.cppentry.com


本文链接: http://www.dtmao.cc/news_show_1100094.shtml

附件下载

相关教程

    暂无相关的数据...

共有条评论 网友评论

验证码: 看不清楚?