fork(1) download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4. void func(char *s) {}
  5. int main()
  6. {
  7. char buf[100];
  8. while (scanf("%s", buf) == 1)
  9. {
  10. printf("input = %s\n", buf);
  11. int n = atoi(buf);
  12. strcat(buf, "0");
  13. if (atoi(buf) == n)
  14. printf("string\n");
  15. else
  16. printf("number\n");
  17. }
  18. return 0;
  19. }
  20.  
Success #stdin #stdout 0s 2252KB
stdin
1234
1234abncdef
ab^d34x
-92837
+37
stdout
input = 1234
number
input = 1234abncdef
string
input = ab^d34x
string
input = -92837
number
input = +37
number