C/C++ 언어 kbhit() 함수를 사용한 예제프로그램


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/*kbhit() 함수를 사용한 예제프로그램*/
#include <stdio.h>
#include <conio.h>
 
void main(void) {
  double amount;
 
  amount = 0.20;
  printf("5% 세금표 출력\n");
  printf("종료하려면 아무키나 누르세요.\n");
  printf("-------------------------\n");
  do { 
    printf"세율:%lf, 세금:%lf\n", amount, amount * 0.05);
    if (kbhit()) break;
    amount = amount + 0.20;
  } while ( amount < 10000.0) ;
}
 
cs


C/C++ 언어 kbhit() 함수를 사용한 예제프로그램



+ Recent posts