Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 2
- 8 5
- 1 1 1 2 3 4 5 6
- 4 7
- 1 2 3 4
- int main()
- {
- int number;
- string filePath;
- int numberOfInstances;
- int Max;
- int Rings;
- cout << "please input your file path: " ; //ie, D:\sample.txt
- cin >> filePath;
- ifstream fin;
- fin.open(filePath.c_str());
- if(fin.fail()) {
- cout << "sorry, fail to open" << endl;
- exit(1);
- }
- fin >> numberOfInstances;
- vector<int> vect1;
- for(int i = 0; i < numberOfInstances; i++) {
- fin >> Rings;
- fin >> Max;
- for(i = 0; i < Rings; i++) {
- fin >> number;
- vect1.push_back(number);
- }
- //
- //code to process Vect1, eg, sort it
- //
- for(i = 0; i < Rings; i++) {
- vect1.pop_back();
- }
- }
- fin.close();
- return 0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement