fork download
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. int main() {
  6. string text;
  7. int noLines = 0;
  8. while (getline(cin, text)){
  9. ++noLines;
  10. if (noLines == 2) {
  11. cout << text;
  12. }
  13. cout << noLines;
  14. }
  15. if (noLines <= 1) {
  16. cout << "text prea scurt";
  17. }
  18. return 0;
  19. }
Success #stdin #stdout 0s 5264KB
stdin
Standard input is empty
stdout
text prea scurt