求一个用于表白的C语言或C++的程序,谢谢大家了

求一个用于表白的C语言或C++的程序,谢谢大家了,第1张

#include <stdio.h>

#include <math.h>

#include <stdlib.h>

#define I 20

#define R 340

#include <string.h>

int main()

{

char answer[10]

printf("遇到你\n我才发现\n曾经所有的条件\n似乎都成了我等你的借口\n\n")

printf("我对你的感情已经决堤\n所以\n请允许我,从今往后映入你\n明媚的眼\n")

printf("我\n想和你\n耳鬓厮磨,相濡以沫!")

printf("答应我吧!\n输入yes,你可以看到我的真心\n")

scanf("%s", answer)

float y, x, z, f

for (y = 1.5fy >-1.5fy -= 0.1f)

{

for (x = -1.5fx <1.5fx += 0.05f)

{

z = x * x + y * y - 1

f = z * z*z - x * x*y*y*y

putchar(f <= 0.0f ? "*********"[(int)(f*-8.0f)] : ' ')

}

putchar('\n')

}

long time

for ()

{

system("color a")

for (time = 0time<99999999time++)

system("color b")

for (time = 0time<99999999time++)

system("color c")

for (time = 0time<99999999time++)

system("color d")

for (time = 0time<99999999time++)

system("color e")

for (time = 0time<99999999time++)

system("color f")

for (time = 0time<99999999time++)

system("color 0")

for (time = 0time<99999999time++)

system("color 1")

for (time = 0time<99999999time++)

system("color 2")

for (time = 0time<99999999time++)

system("color 3")

for (time = 0time<99999999time++)

system("color 4")

for (time = 0time<99999999time++)

system("color 5")

for (time = 0time<99999999time++)

system("color 6")

for (time = 0time<99999999time++)

system("color 7")

for (time = 0time<99999999time++)

system("color 8")

for (time = 0time<99999999time++)

system("color 9")

}

getchar()

return 0

}

运行效果:

扩展资料:

printf函数使用注意事项

1、域宽

%d:按整型数据的实际长度输出。

如果想输出指定宽度可以指定域宽,%md--&gt;m域宽,打印出来以后,在控制台上,显示m位;

如果我们要打印的数的位数如果超过我们设定m则原样输出;

如果我们要打印的数的位数如果小于我们设定的位数,则补空白,具体如下:

如果m为正数,则左对齐(左侧补空白);

如果m为负数,则右对齐(右侧补空白)。

2、转义字符

如果想输出字符"%",则应该在“格式控制”字符串中用连续两个%表示。

如:printf("%f%%",1.0/3);输出结果:0.333333%。

#include <stdio.h>

#include <stdlib.h>

#include <time.h>

#include "conio.h"

void main()

{

int year=0,month=0,day=0,hour=0,mintue=0,second=0

printf("Input the day you tell your trues:(Year-Mou-Day-Hour-Min-Sec,default for 0):\n")

scanf("%d-%d-%d-%d-%d-%d",&year,&month,&day,&hour,&mintue,&second)

system("cls")

time_t now,trues,toget

while(1)

{

struct tm truest = {second,mintue,hour,day,month-1,year-1900}

now = time(NULL)

trues=mktime(&truest)

printf("now is %s\n",ctime(&now))

printf("the day you tell your trues:%s\n",ctime(&trues))

toget = (now-trues)/3600/24

printf("days together:%d\n",toget)

toget = (now-trues)/3600

printf("hours together:%d\n",toget)

toget = (now-trues)/60

printf("mintues together:%d\n",toget)

toget = (now-trues)

printf("seconds together:%d\n",toget)

_sleep(1000)

system("cls")

}

}

祝你成功


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/yw/11223515.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-14
下一篇 2023-05-14

发表评论

登录后才能评论

评论列表(0条)

保存