Created
September 13, 2013 16:35
-
-
Save JAChapmanII/6552983 to your computer and use it in GitHub Desktop.
stringstream input
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <sstream> | |
using namespace std; | |
int main() { | |
stringstream ss; | |
ss << "5 10 20"; | |
cin.rdbuf(ss.rdbuf()); | |
int n; | |
while(cin >> n) { | |
cout << "n: " << n << endl; | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment