fork download
  1. #include <iostream>
  2. #include <string>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. int i = 1;
  9. string token;
  10.  
  11. while(!cin.eof())
  12. {
  13. cin >> token;
  14. cout << i << ": " << token << '\n';
  15. i++;
  16. }
  17. }
Success #stdin #stdout 0s 3020KB
stdin
one
two
three
four
stdout
1: one
2: two
3: three
4: four
5: four