language: C++ 4.7.2 (gcc-4.7.2)
date: 630 days 9 hours ago
link:
visibility: public
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include <iostream>
#include <cstring>
 
using namespace std;
 
int main ()
{
  string line;
  char * parse;
 
  while (getline(cin, line)) {
 
    char * writable = new char[line.size() + 1];
    copy (line.begin(), line.end(), writable);
    parse = strtok (writable," (,)");
 
    while (parse != NULL)
    {
      cout << parse << endl;
      parse = strtok (NULL," (,)");
      cout << parse << endl;
      parse = strtok (NULL," (,)");
      cout << parse << endl;
      parse = strtok (NULL," (,)");
    }
 
  }
  return 0;
}