-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnQueensAnsDiff.cpp
More file actions
36 lines (35 loc) · 898 Bytes
/
Copy pathnQueensAnsDiff.cpp
File metadata and controls
36 lines (35 loc) · 898 Bytes
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
// For N-Queens cuz too lazy to determine difference one by one
#include <iostream>
#include <vector>
#include <string>
using namespace std;
int main() {
vector<vector<string> > myAnswer, correctAnswer;
vector<string> myAnswerVect, correctAnswerVect;
string myAnswerStr, correctAnswerStr;
int n;
cout << "Input n: ";
cin >> n;
cout << "Input my answer: " << endl;
int i = 0;
while (cin >> myAnswerStr && myAnswerStr != "end") {
if (i == n) {
myAnswer.push_back(myAnswerVect);
myAnswerVect.clear();
i = 0;
}
myAnswerVect.push_back(myAnswerStr);
i++;
}
cout << "Input correct answer: " << endl;
i = 0;
while (cin >> correctAnswerStr && correctAnswerStr != "end") {
if (i == n) {
correctAnswer.push_back(correctAnswerVect);
correctAnswerVect.clear();
i = 0;
}
correctAnswerVect.push_back(correctAnswerStr);
i++;
}
}