Guest User

Untitled

a guest
Jan 19th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. string input = "2 columns 2 rows all * go"; // Read it from some input
  2. istringstream iss(input);
  3.  
  4. vector<string> tokens;
  5. copy(istream_iterator<string>(iss),
  6. istream_iterator<string>(),
  7. back_inserter<vector<string> >(tokens));
  8.  
  9. int columns = atoi(tokens[0].c_str());
  10. int rows = atoi(tokens[2].c_str());
Add Comment
Please, Sign In to add comment