#include <iostream>
#include <string>
#include <ctime>
using namespace std;

int main() {
    const string WORD[] = { "apple", "box", "cat", "dog", "elephant", "flag", "gold" };
    const int WORD_MAX = sizeof(WORD) / sizeof(WORD[0]);
    int word_num = 0;
    string in_word;
    cout << "ゲームスタート！" << endl;
    time_t start_time = time(NULL);
    while (true) {
        cout << (word_num + 1) << "つ目の単語 " << WORD[word_num] << endl;
        cin >> in_word;
        if (in_word == WORD[word_num]) {
            cout << "OK!" << endl;
            word_num++;
            if (word_num == WORD_MAX) break;
        }
        else {
            cout << "正しく入力しましょう" << endl;
        }
    }
    time_t end_time = time(NULL);
    int elapsed_time = end_time - start_time;
    cout << "------------------------------" << endl;
    cout << "終了です" << endl;
    cout << "掛かった時間 " << elapsed_time << "秒" << endl;
    cout << "1単語の平均入力時間 " << elapsed_time / WORD_MAX << "秒" << endl;
}