fork download
  1. #include <stdio.h>
  2.  
  3. int main(void)
  4. {
  5. FILE *src = stdin;
  6. // Скипаем строку.
  7. if (fscanf(src, "%*[^\n]%*[\n]") < 0)
  8. {
  9. fprintf(stderr, "Expected at least one string\n");
  10. return 1;
  11. }
  12.  
  13. // Читаем оставшиеся.
  14. while (1)
  15. {
  16. char buffer[1024];
  17. if (!fgets(buffer, sizeof(buffer), src))
  18. {
  19. if (!feof(src))
  20. {
  21. perror("Input error");
  22. return 1;
  23. }
  24. break;
  25. }
  26.  
  27. printf("Got: \"%s\"", buffer);
  28. }
  29.  
  30. return 0;
  31. }
  32.  
Runtime error #stdin #stdout #stderr 0s 4384KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Expected at least one string