#include "stdio.h" #include "stdlib.h" int main() { int c; /* must be int, not char, for getchar */ while ((c = getchar()) != EOF) { putchar(c); } return ferror(stdin) ? EXIT_FAILURE : EXIT_SUCCESS; }