Answer to Question #276188 in C++ for aaaaaaa

Question #276188

I want you to make a array of numbers for me. All you have to do is make a program that will let me input any random integer in one line. Afterwards, it will then print out all the numbers I've inputted, on separate lines.



1
Expert's answer
2021-12-06T14:04:38-0500
#include <iostream>
#include <string>
#include <sstream>


using namespace std;


int main() {
    int number;
    string lineNumbers;


    getline(cin, lineNumbers);
    stringstream ss(lineNumbers);


    while (!ss.eof()) {
        ss >> number;
        cout << number << endl;
    }
 
	system("pause");
	return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment