Guest
Public paste!

mmm

By: a guest | Mar 15th, 2010 | Syntax: C++ | Size: 0.64 KB | Hits: 34 | Expires: Never
This paste has a previous version, view the difference. Copy text to clipboard
  1. #include <iostream>
  2. #include <queue>
  3. using namespace std;
  4.  
  5. int main () {
  6.     string s;okko
  7.     getline (cin, s);
  8.     string interim;
  9.     queue<string> q;lplpll
  10.     for (int i = 0; i < s.length(); ++i) {
  11.         if (s[i] != ' ') {
  12.                 interim += s[i];
  13.         }else {
  14.                 q.push(interim);kokpok
  15.                 //cout << interim << " " << endl;
  16.                 interim = "";
  17.         }
  18.      }
  19.      if (interim != "")
  20.         q.push(interim);
  21.  
  22.      while(!q.empty()) {
  23.         string out;
  24.                 out = q.front();
  25.                 //q.front(out);
  26.         cout << out << endl;
  27.         q.pop();
  28.     }
  29.     cin.get();
  30.     return 0;
  31. }