12個の文字列をすべて出題するのではなく、10個をランダムに選んで出題するように変更したものを作成したのですが、 'getputch.h' file not foundとエラーが出てプログラムを実行できないのですがどうすればいいですか?ちなみにC言語中級編の問題です。どなたかよろしくお願いします。
#include <time.h> #include <stdio.h> #include <stdlib.h> #include "getputch.h" #define QNO 12 #define QNO 10 #define swap(type, x, y) do{ type t =x; x=y; y=t;}while(0) int main(void) { char *str[NO] = {"book", "computer", "define", "comfort","monday","power","light","music","programming","dog","video","include"}; char *str[12] = {"book", "computer", "define", "comfort","monday","power","light","music","programming","dog","video","include"}; int i, stage; int qno[QNO]; clock_t start, end; init_getputch(); srand(time(NULL)); for (i=0; i<QNO; i++) qno[i]=i; for(i=QNO-1; i>0; i--){ int j =rand()%(i+1); if (i!=j) swap(int, qno[i], qno[j]); } printf("タイピング練習を始めます。\n"); printf("スペースキーで開始します。\n"); while (getch() !=' ') ; start = clock(); for(stage=0; stage<QNO; stage++){ int len=strlen(str[qno[stage]]); for(i=0; i<len; i++){ printf("%s\r", &str[qno[stage]][i]); fflush(stdout); while(getch() != str[qno[stage]][i]) ; } } end= clock(); printf("\r%.1f秒でした。\n", (double)(end-start)/CLOCKS_PER_SEC); term_getputch(); return 0; }

バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2022/07/02 04:53
2022/07/02 05:00
2022/07/02 05:29