fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <stdbool.h>
  4.  
  5. int main(void) {
  6. int numccr = 0;
  7. char inchar;
  8.  
  9. while (true) {
  10. fscanf(stdin, "%c", &inchar);
  11. fprintf(stderr, "%c", inchar);
  12. if (inchar == '\n') {
  13. numccr++;
  14. printf("%d", numccr);
  15. if (numccr == 2) {
  16. break;
  17. } else {
  18. numccr = 0;
  19. }
  20. }
  21. }
  22. fprintf(stdout, "HTTP/1.1 200 OK\n \
  23. Content-Length: NN\n \
  24. Content-Type: text/html\n \
  25. Date: Thu Jan 1 00:00:00 JST 2012\n \
  26. \n \
  27. あなたが作ったwebページの中身");
  28. fprintf(stderr, "HTTP/1.1 200 OK\n \
  29. Content-Length: NN\n \
  30. Content-Type: text/html\n \
  31. Date: Thu Jan 1 00:00:00 JST 2012\n \
  32. \n \
  33. あなたが作ったwebページの中身");
  34. return EXIT_SUCCESS;
  35. }
  36.  
Runtime error #stdin #stdout #stderr 0.12s 5488KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr