Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <fstream>
- #include <algorithm>
- #include <iterator>
- using namespace std;
- int number[100];
- const char* question[100];
- int i,c = 0;
- string line;
- int kek = 0;
- void readFile() {
- ifstream questions("questions.txt");
- while (getline(questions, line)) {
- if (line.substr(0, 1) == "#") {
- string tmp1 = line.substr(1, 20);
- remove(line.begin(), line.end(), ' ');
- if (tmp1 != "1") question[i] = tmp1.c_str();
- i++;
- questions.ignore(numeric_limits<streamsize>::max(), '\n');
- } else {
- number[c] = atoi(line.substr(0,1).c_str());
- c++;
- questions.ignore(numeric_limits<streamsize>::max(), '\n');
- }
- kek++;
- }
- questions.close();
- }
- int main() {
- readFile();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement