c++源代码---停车计时系统

2017-08-30 19:08:12来源:CSDN作者:crazystar001人点击

分享
第七城市
#include <ctime>#include <iostream>#include <windows.h>using namespace std ;void main(void){    long in_time, out_time;    int a,b;    cout<<"waiting time(minute)"<<endl;;    cin>>a;    b=a*1000;    time(&in_time); //得到入场时间    cout << "in time: " <<ctime(&in_time) <<endl ;    //停留    Sleep(b); //模拟停三秒    time(&out_time);    cout << "out time: " <<ctime(&out_time) <<endl ;    cout << "stop time: " <<out_time-in_time <<"s"<<endl ;}

运行结果

第七城市

微信扫一扫

第七城市微信公众平台