fork download
#include <iostream>
#include <string>

using namespace std;

int main()
{
    int i = 1;
    string token;

    while(cin >> token)
    {
        cout << i << ": " << token << '\n';
        i++;
    }    
}
Success #stdin #stdout 0s 3020KB
stdin
one
two
three
four
stdout
1: one
2: two
3: three
4: four