这是一个简单的表白代码,运用了c语言的编译工具,因为很早之前百度来的,也不记得出处在哪里,注明:转载
#include <windows.h> //win头文件
#include<stdio.h>
#include<stdio.h>
#include<math.h>
#include <windows.h>
#define r 10
#define R 172
int main()
{int i;printf("我");fflush(stdout); //强制刷新缓存,输出显示Sleep(1000);
printf("自");
fflush(stdout);
Sleep(1000);
printf("从");
fflush(stdout);
Sleep(1000);
printf("遇");
fflush(stdout);
Sleep(1000);
printf("见");
fflush(stdout);
Sleep(1000);
printf("你\n");
fflush(stdout);
Sleep(1000);
printf("就");
fflush(stdout);
Sleep(1000);
printf("好");
fflush(stdout);
Sleep(1000);
printf("喜");
fflush(stdout);
Sleep(1000);
printf("欢");
fflush(stdout);
Sleep(1000);
printf("你"); fflush(stdout); for( i=0;i<5;i++ ){
Sleep(1000);
printf(".");fflush(stdout);
}printf("\n");
int j,e;
int a;
int n;
FILE *fp;
if((fp=fopen("LOVE.txt","w"))==NULL)
{
printf("File open error!\n");
exit(0);
}
for(i=1,a=r;i<r/2;i++,a--)
{
for(j=(int) ( r-sqrt((r*r-(a-i)*(a-i))) );j>0;j--)
{
printf(" ");
fprintf(fp,"%s"," ");
}
for(e=1;e<=2*sqrt((r*r-(a-i)*(a-i)));e++)
{
printf("\3");
fprintf(fp,"%s"," * ");
}
for(j=(int) ( 2*( r-sqrt((r*r-(a-i)*(a-i)))) );j>0;j--)
{
printf(" ");
fprintf(fp,"%s"," ");
}
for(e=1;e<=2*sqrt( (r*r-(a-i)*(a-i)) );e++)
{
printf("\3");
fprintf(fp,"%s"," * ");
}
printf("\n");
fprintf(fp,"%s","\n");
}
for(i=1;i<40;i++)
{
if(i==6)
{
printf("(∩_∩)YOU AND ME(∩_∩)");
i+=24;
}
printf("\3");
fprintf(fp,"%s"," * ");
}
printf("\n");
for(i=1;i<=R/2;i++)
{
if(i%2||i%3)continue;
for(j=(int) ( R-sqrt( (double) (R*R-i*i) ) );j>0;j--)
{
printf(" ");
fprintf(fp,"%s"," "); }
for(e=1;e<=2*( sqrt( (double)(R*R-i*i) ) - (R-2*r) );e++) {
printf("\3");
fprintf(fp,"%s"," * " );
} printf("\n");}
//printf("自动播放:按任意键 ,自己控制:按 0\n");
//printf("按完后请按enter键\n");
scanf("%d",&n);
if(n==0)
{
while(n=1)
{
system("color a");
system("pause");
system("color b");
system("pause");
system("color c");
system("pause");
system("color d");
system("pause");
system("color e");
system("pause");
system("color f");
system("pause");
}
}
else
{
while(1)
{
system("color a");
Sleep(100);
system("color b");
Sleep(100);
system("color c");
Sleep(100);
system("color d");
Sleep(100);
system("color e");
Sleep(100);
system("color f");
Sleep(100);
system("color 0");
Sleep(100);
}
}
return 0; }