U E D R , A S I H C RSS

시간맞추기/허아영

,
-_- .
..;
.
kbhit() , 1, 0 .

고, . . 8 !! ㅋㅋㅋ
! ㅋㅋ

~cpp 
#include <stdio.h>
#include <conio.h>
#include <time.h>

void main()
{
	time_t record = 8;
	time_t start_t;
	start_t = time(0);
	printf("wait 8 seconds...\n");
	printf("and press any key exactly...");
	for( ; ; )
	{
		if (kbhit()){
			if(start_t - record == 0)
			{
				printf("You win !!\n");
			}else{
				printf("your time is off.");
			}
			break;
		}
			
	}	
	getch();
}
. 8 .
↓↓ 고
~cpp 
#include <stdio.h>
#include <conio.h>
#include <time.h>

void main()
{
	time_t record = 8;
	time_t start_t;
	start_t = time(0);
	printf("wait 8 seconds...\n");
	printf("and press any key exactly...");
	for( ; ; )
	{
		if (kbhit()){
			if(time(0) - start_t == record)
			{
				printf("You win !!\n");
			}else{
				printf("your time is off.");
			}
			break;
		}

	}
	getch();
}

! ㅎ

~cpp 
#include <stdio.h> 
#include <conio.h> 
#include <time.h> 

void main() 
{ 
	time_t record = 8; 
	time_t start_t; 
	start_t = time(0); 
	printf("wait 8 seconds...\n"); 
	printf("and press any key exactly..."); 
	for( ; ; ) 
	{ 
		if (kbhit()){ 
			if(time(0)-start_t  == record-1 ) //  
			{ 
				printf("You win !!\n"); 
			}else{ 
				printf("your time is off."); 
			} 
			break; 
		} 
	}        
	getch(); 
} 
..^^
깝게 .^^
time(0) 고(time(0)-start_t ),
record 9( 0^^) -1 .

걸..^^ 구~ !!
.. -

- .. 9 .. ㅎㅎ ~ ㅋㅋㅋ
0~1,->1, ,, record 게 8 ㅎㅎ
- ㅎㅎㅎㅎ 그 ..ㅎㅎㅎ
..그 그게 ..ㅎㅎㅎ
time() ..ㅎㅎ
0 -> 1 0 , 1 ..ㅎㅎㅎ
time() ..ㅎㅎ ..ㅎㅎㅎ
.. ~~
...ㅎㅎㅎ ..ㅎㅎ ~^^ .ㅎㅎ 그 고 -
clock() , 걸까? -
.. clock_t time_t =clock() 군.. 그 ..;;ㅁ;; -
. ㅋㅋ . ~ . -



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