闲着没事,整点小玩意儿

· · 个人记录

正如标题所说

#include<bits/stdc++.h>
#include<windows.h>
#define out cout
#define in cin
using namespace std;

inline void read(int *a)
{
  int f=1,x=0;
  char ch = getchar();
  if(ch=='-')f = -1,ch = getchar();
  for(;ch>='0'&&ch<='9';x=(x<<1)+(x<<3)+(ch^48),ch=getchar());
  *a = f*x;
}
int main(int argc,char *argv[])
{
  system("color 0a");
  srand((unsigned)time(NULL));
  while(true)
  {
    out << "请输入你的期末考试分数:" << endl;
    int temp;
    read(&temp);
    out << "正在运算……" << endl;
    Sleep(1000);
    out << "您的暑假游戏时长为" << temp*(rand()% 30+20) << endl;
    Sleep(1000);
    system("cls");
  }
  system("exit");
  return 0;
}