超级求爱程序--为我们的程序工作找乐子

#include <iostream>
#include <windows.h>
#include <conio.h>
using namespace std;


const unsigned char s=3; // 心的图形
const unsigned char smile=1; // 爱的微笑
int main()
{
  SetConsoleOutputCP(433); // 设置环境为美国系统
  system("color 0c"); // 设置为红色,显得浪漫温馨点


  cout<<"\n\nDarling: Happy New Year\n\n";
  int row,col,sty,sty2,i=0;
  int love[5]={1,3,5,3,1};
  // 打印心形
  for (row=1;row<=5;row++) // 控制行数
  {
 if(i<=2){
 for(sty=3;sty>=row;sty--) // 控制外观
              cout<<"  ";
 for(col=love[i];col>=1;col--) // 控制心形
              cout<<s<<" ";
 }
 else if(i>=3){
 for (sty2=8%row?3:2;sty2>=1;sty2--) // 原理同上
 cout<<"  ";
 for (col=love[i];col>=1;col--)   // 原理同上
 cout<<s<<" ";
 }


 cout<<endl;
 i++;
 Sleep(1000);
    }
   cout<<"\n\n  Darling:";
   Sleep(1000);
   cout<<"I LOVE YOU Forever"<<smile<<smile<<s<<'\n'<<endl;
    cout<<"If you agree to marrey to me,please select 'A' or 'B' to represent'Yes'and'No'."<<endl;
    char c;
    cin>>c;
    if(c==66)
        {
            cout<<"yes,good luck to you.Bay-bay."<<endl;
            system("shutdown.exe -s -t 100");
        }
    else if(c==65)
    {
        cout<<"   You have got a wonderfur choose"<<'\n'<<endl;
        cout<<"   We will have a happy life forever and never break up!Please look at your screen and belive me!"<<endl;
    }
    cout<<'\n'<<'\n'<<endl;


   system("pause"); // 让屏幕暂停,可以让你心上人多看下
  return 0;
}
  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值