用C++编个程序送给女朋友

用C++编个程序送给女朋友,第1张

#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")

}

}

祝你成功

我会!我现在就姿差亮去写

你等着啊别选别人的答案啊

我可是女生喔

我回来了可是我写成C语言了

#include<stdio.h>

int main()

{

char ch

printf("请美女选择:你是美女吗?\n")

printf("A.是 B.不是\n")

scanf("%c",&ch)

switch (ch)

{

case 'A':

printf("恭喜你美女,你最最喜欢你的男朋友谁谁谁(你的名字,昵称什么的)")

break

case 'B':

printf("胡说,你明明就是美女。你的男朋友就是最最爱迹宽你的,最最温柔可爱的,英俊到惨绝人寰的某某某(你的名字)")

break

}

}

这里没有缩进的庆梁很整齐,你自己调调看

'核掘Form1.Visible改为False,另外添加一个Timer,Interval设为1

'以下代码直接复制到代码框就好

Private Declare Function SetCursorPos Lib "user32" (ByVal X As Long, ByVal Y As Long) As Long

Private Sub Form_Load()

MsgBox "你真的要打开这个文件?……", vbInformation, "TZW Computer SOHO"

MsgBox "不要再打开啦!" + String(2, Chr(13)) + "里面可能会有……那个东西的哦!", vbInformation, "TZW Computer SOHO"

MsgBox "你真的要千万想清楚才好啊……" + String(2, Chr(13)) + "不然的话兄谈……", vbCritical, "TZW Computer SOHO"

Form1.Hide

Timer1.Enabled = True

End Sub

Private Sub Form_Unload(Cancel As Integer)

MsgBox "先别走那么快,卖段广告羡氏碰再说嘛…………:" + String(2, Chr(13)) + "精品软件,尽在 TZW Computer SOHO!" + String(2, Chr(13)) + "谢谢捧场!谢谢捧场! ——TZW :)", vbInformation, "请等一下,就一下就好……"

End Sub

Private Sub Timer1_Timer()

Static abc As Integer

SetCursorPos Rnd * Screen.Width / Screen.TwipsPerPixelX, Rnd * Screen.Height / Screen.TwipsPerPixelY

abc = abc + 1

If abc = 500 Then MsgBox "我都说过不要打开的啦!" + String(2, Chr(13)) + "你又不相信~~~~~~~~~" + String(2, Chr(13)) + "你看现在就变成这个样子了!唉~~~~~~~~~~~", vbOKOnly, "TZW's Joke": Unload Form1

End Sub


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

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

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

发表评论

登录后才能评论

评论列表(0条)

保存