대충 코드는 아래와 같습니다.
43행에서 getch로 입력을 할수있게 만들었는데 막상 컴파일해서 실행시켜보면 입력을 할 수가 없네요.
고수님들 도와주세요!!여친생기실겁니다!!!!
1 #include <stdio.h>
2 #include <time.h>
3 #include <string.h>
4 #include "getch.h"
5
6 int main()
7 {
8 char mysent; //타자연습의 입력값 저장
9 char longsent[5][10][100]={{"AND THEN THERE WERE NONE",
10 "In the coner of a first-class smoking carriage,Mr.Justice Wargrave,lately retired from the bench.",
11 "ran an interested eye through the political news in the The Times.",
12 "He laid the paper down and glanced out of the window.",
13 "They were running now through Somerset."},
14 {"He glanced at his watch-another two hours to go."
15 ,"He went over in his mind all that had appeared int the papers about Soldier Island."
16 ,"There had been its original purchase by an Amreican millionaire"
17 ,"who was crazy about yatchting-and an account of the luxurious modern house"
18 ,"he had built on this little island off the Devon coast."},
19 {"The unfortunate fact that the new third wife of the American milionaire"
20 ,"was a bad sailor had led to the subsequent putting up of he house and island fo sale."
21 ,"Various glowing advertisements of it had appeared in the papers."
22 ,"Then came the first baldstatement that it had been bought-by a Mr.Owen."
23 ,"After that the rumorous of the gossip writers had strted."},
24 {"Janas knew a fact that it had been purchased by the Admiralty with very hush-hush expriments!"
25 ,"Definitely,Soldier Island was news!"
26 ,"From his pocket Mr.Justice Wargrave drew out a letter."
27 ,"The hand writing was practically illegible."
28 ,"Mr.Justice Wargrave cast back his mind to remember."}};
29 int pro=0; //진행도
30 int x=0,z=0,a=0;
31 int start=0,end=0;//시작시간과 끝나는시간
32 int which=0;
33 int rand_n; //무작위로 긴글을 설정할수 있게함
34 srand(time(NULL));
35 rand_n=rand()%5;
36
37 printf(">> 영문 타자 연습 프로그램 : 긴 글 연습 <<\n");
38
39 for(a=0;a<5;a++)
40 printf("%s\n",longsent[rand_n][a]); //첫째페이지 출력 완료
41 while(1)
42 {
43 mysent = getch();
44 if(mysent == 13 && which !=0) //ENTER입력시 문장입력 종료
45 break;
46 if(mysent == 27) //ESC입력시 프로그램 종료
47 return 0;
48 if(which !=0)
49 {
50 printf("\b \b"); //화면에 한글자 지우기
51 which--;
52 }
52 }
53
54 }
55
56 return 0;
57 }
제발..
http://dblack.tk
커뮤니티 사이트 입니다 많은 이용 부탁 드립니다.