Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <string>
- using namespace std;
- void clean();
- int main() {
- ifstream glosor("glosor.txt");
- int right = 0;
- int wrong = 0;
- int i, i2;
- string svenska[32];
- string other[32];
- string answer[32];
- for(i = 0; i<30; i++) {
- glosor >> svenska[i] >> other[i];
- }
- clean();
- for(i2 = 0; i2<30; i2++) {
- cout << svenska[i2] << " - ";
- cin >> answer[i2];
- cout << endl;
- if(answer[i2] == other[i2]) {
- right++;
- } else if(answer[i2] == "p") {
- cout << "Right: " << right << endl
- << "Wrong: " << wrong << endl;
- i2--;
- } else if(answer[i2] == "cls") {
- clean();
- } else if(answer[i2] == "exit") {
- break;
- }
- else {
- wrong++;
- }
- }
- cin.ignore();
- clean();
- cout << "Right: " << right << endl
- << "Wrong: " << wrong << endl;
- cout << "Press >ENTER< too exit!";
- cin.get();
- return 0;
- }
- void clean() {
- for(int x = 0; x<25; x++) {
- cout << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement