Sign in

gwj / po_oopc · Files

GitLab

  • Go to dashboard
  • Project
  • Activity
  • Files
  • Commits
  • Network
  • Graphs
  • po_oopc
  • examples01-pl
  • 12-vector
  • vector.cpp
  • Reformatted code
    c0b14c54
    Grzegorz Jabłoński authored
    2022-09-16 14:36:36 +0200  
    Browse Code »
vector.cpp 307 Bytes
Edit Raw Blame History
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
#include <iostream>
#include <string>
#include <vector>
using namespace std;

int main()
{
    string word;
    vector<string> v;
    while (cin) {
        if (cin >> word)
            v.push_back(word);
    }
    for (unsigned int i = 0; i < v.size(); i++)
        cout << v[i] << " ";
    cout << endl;
}