-
Notifications
You must be signed in to change notification settings - Fork 4
/
HaiZuka.cpp
82 lines (69 loc) · 1.66 KB
/
HaiZuka.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#include <iostream>
#include <fstream>
#include <string>
#include <windows.h>
#include <conio.h>
using namespace std;
void loading() {
system("color 0A");
char a = 177, b = 219;
cout << "\n\t\t\t\t\t\tLoading...\n\n";
cout << "\t\t\t\t\t";
for (int i = 0; i < 26; i++)
cout << a;
cout << "\r";
cout << "\t\t\t\t\t";
for (int i = 0; i < 26; i++) {
cout << b;
Sleep(350);
}
cout << "\nStart..........!!!";
Sleep(1000);
system("cls");
cout << std::endl;
system("color F");
}
void question() {
fstream f;
string question[100], correct[100], answer;
f.open("question.txt", std::ios::in);
int N = 0;
while (!f.eof()) {
getline(f, question[N]);
getline(f, correct[N++]);
}
f.close();
cout << "Correctly answer " << N << " questions to continue." << endl;
cout << "Contact https://github.com/zukahai/DrawImage-CPP if difficult" << endl << endl;
for (int i = 0; i < N; i++) {
cout << "Question " << (i + 1) << ": " << endl;
do {
cout << question[i] << endl;
cout << "Your answer: ";
getline(cin, answer);
if (answer != correct[i]) {
cout << "The answer is not right to try again." << endl;
}
} while (answer != correct[i]);
cout << endl;
}
}
void drawImage() {
fstream f;
f.open("input.txt", std::ios::in);
if (f.is_open()) {
std::string tp;
while (getline(f, tp)) {
cout << tp << std::endl;
Sleep(100);
}
f.close();
}
string a;
getline(cin, a);
}
int main() {
question();
loading();
drawImage();
}