基本信息
源码名称:c++表白代码(可自定义姓名和文字)
源码大小:1.85KB
文件格式:.cpp
开发语言:C/C++
更新时间:2018-05-28
   友情提示:(无需注册或充值,赞助后即可获取资源下载链接)

     嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):813200300

本次赞助数额为: 2 元 
   源码介绍

#include <stdio.h>
#include <math.h>
#include <windows.h>
#include <string.h>
#define GFNAME "陈学梅"
#define U 0.1
#define V 0.057
#define M 1.1
#define N 1.2


void showLove()
{
	double x, y;
	int i=0;
	char WhatYouWantToSay[27][255]={
			" "," "," "," ","亲爱的:",
			"──────────────────",
			"\t~\(≧▽≦)/~","──────────────────",
			"\t你","──────────────────",
			"\t终于来了","──────────────────",
			"\t世界是黑暗的","──────────────────",
			"\t唯有有你的地方才是光明",
			"──────────────────","\t★我★爱★你★!",
			"──────────────────",
			"\t不需要太多的言语去修饰",
			"──────────────────",
			"\t我要你幸福","──────────────────",
			" ","\t2018年8月17日"," ","\t---永远爱你的:张升include"," "
		};

	for(y = 1.3;y >= -1.3; y -= U)
	{

		for(x = -1.2; x <= 2.7; x  = V)
		{
			if((( (x*x   y*y - 1)*(x*x   y*y - 1) * (x*x   y*y - 1)
				-x*x*y*y*y )<= 0))
				printf("*");

			else if(x>1.2){
				printf("\t");

			for(int j=0;WhatYouWantToSay[i][j]!='\0';j  )
			{
				printf("%c",WhatYouWantToSay[i][j]);

				if(i%2)
					Sleep(1);
				else
					Sleep(rand()%90);
				}
			if(i==4)
					printf("★%s★",GFNAME);
				break;
			}
			else
				printf(" ");
			fflush(stdout);
			Sleep(10);
		}
		printf("\n");
		i  ;
	}
}
void showSkull()
{
	char filename[]="kl.txt";
	FILE *fp;
	if(!(fp=fopen(filename,"a ")))
		printf("Can't open the file!\n");
	char buf[128];
	while(fgets(buf,128,fp))
	{
		printf("\t\t\t%s",buf);
	}
	printf("\n");

}
int main()
{
	char name[32];
	printf("\t\t\t请输入你的名字,回车确定:\n\t\t\t");
	scanf("%s",name);
	system("cls");
	if(strcmp(name,GFNAME)==0)
		showLove();
	else
		showSkull();
	return 0;
}