fork download
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. int main(void) {
  5. char str[300];
  6. while( fgets(str, sizeof str, stdin)) {
  7. if(str[0] != '\n') printf("not ");
  8. printf("empty\n");
  9. str[ strlen(str) - 1 ] = '\0';
  10. }
  11. return 0;
  12. }
  13.  
Success #stdin #stdout 0s 2056KB
stdin
abc


abc
abc

abc
stdout
not empty
empty
empty
not empty
not empty
empty
not empty