fork download
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. #define LEN 10
  5.  
  6.  
  7. int main(void) {
  8. char str[LEN + 1];
  9.  
  10. fgets(str, sizeof str, stdin);
  11. char *p = strchr(str, '\n');
  12. if (p != NULL)
  13. *p = '\0';
  14. printf("Entree |%s|\n", str);
  15. return 0;
  16. }
Success #stdin #stdout 0s 2160KB
stdin
0123456789
stdout
Entree |0123456789|