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.0194 sec