Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <string.h>
- #include <vector>
- #include <sstream>
- using namespace std;
- int main()
- {
- string newString, input;
- vector <int> nums(1);
- vector <int> nums2(1);
- vector <int> nums3(1);
- int k = 0;
- cin >> k;
- cin.ignore();
- while(k--)
- {
- stringstream stream;
- getline(cin,input);
- stream.str(input);
- stream >> newString;
- int firstNumber = stoi(newString);
- stream >> newString;
- int secondNumber = stoi(newString);
- getline(cin, input);
- stream.str(input);
- stream.clear();
- while(stream >> newString)
- {
- // stream.str(input);
- while(stream >> newString)
- {
- nums.push_back(stoi(newString));
- }
- getline(cin, input);
- stream.str(input);
- stream.clear();
- while(stream >> newString)
- {
- nums2.push_back(stoi(newString));
- }
- getline(cin, input);
- stream.str(input);
- stream.clear();
- while(stream >> newString)
- {
- nums3.push_back(stoi(newString));
- }
- for(int i =1; i< nums.size(); i++)
- {
- cout << nums[i] << endl;
- }
- for(int i =1; i< nums2.size(); i++)
- {
- cout << nums2[i] << endl;
- }
- for(int i =1; i< nums3.size(); i++)
- {
- cout << nums3[i] << endl;
- }
- }
- cout << "The first number is: " << firstNumber << " The second number is: " << secondNumber << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement