fork download
  1. #include <iostream>
  2. #include <string>
  3.  
  4. int main() {
  5.  
  6. std::istream& is = std::cin;
  7. std::string str;
  8. int i = 0;
  9. while( std::getline( is, str ) )
  10. {
  11. std::cout << "string " << ++i << ":" << str << std::endl;
  12. }
  13.  
  14. return 0;
  15. }
Success #stdin #stdout 0s 3432KB
stdin
первая
вторая
третья
четвертая
пятая
stdout
string 1:первая
string 2:вторая
string 3:третья
string 4:четвертая
string 5:пятая