U E D R , A S I H C RSS

시간맞추기/조현태

..문 다. time 까..
그런데.. for를 라고 ..ㅠ.ㅜ while 고..
뭔가 for를 for답게 뽀대나게 만들 려고 다보다.^^;;;
그리고 문 다. 라는..1/1000?? 1/100가??
로 그냥 1.ㅎㅎ 8-9 기만 면 된다.^^

~cpp 
#include <iostream>
#include <time.h>
#include <conio.h>
using namespace std;

const int ANSWER_TIME=8;

void main()
{
	int second;
	time_t before_time;
	before_time=time(&before_time);
	for (second=0; !kbhit(); ++second)
	{
		time_t now_time;
		time(&now_time);
		while(now_time==before_time)
		{
			time(&now_time);
		}
		time(&before_time);
	}
	if (second==ANSWER_TIME-1)
		cout << "you win!!!";
	else
		cout << "your time is off." << second;
	system("PAUSE");
}

Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:30:17
Processing time 0.0068 sec