Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <sstream>
- #include <vector>
- using namespace std;
- int array[1000]; // your heighest input range
- int array2[1000] = {};
- vector<int> numbers;
- int main() {
- string nums; // the numbers in the format "1 2 3 4 10 -20"
- getline(cin,nums);
- stringstream stream(nums);
- int i = 0;
- int n;
- while(stream >> n){
- array[i++] = n;
- // numbers.push_back(n);
- }
- getline(cin,nums);
- stream.str(nums);
- i = 0;
- stream.clear(); // tova e reda, koito opravq neshtata
- while(stream >> n){
- array2[i++] = n;
- // numbers.push_back(n);
- }
- for(int i = 0; i<=10; i++)
- {
- cout << array[i] << " " << array2[i]<<endl;
- }
- // The number of integers in array is i. You can do anything with this number.
- // numbers contains the input numbers.
- return 0;
- }
Add Comment
Please, Sign In to add comment