#include #include #include #define TTY "/dev/tty" int main(int argc, char *argv[]) { freopen(TTY, "w", stdout); if (argc > 1) { for (int i = 1; i < argc; i++) printf("%s ", argv[i]); printf("\n"); } else { while (true) { int c = getchar(); if (c == EOF) break; putchar(c); } } return EXIT_SUCCESS; }