#include <stdio.h>

/* copy input to output; 1st version */

main()
{
	int c;

	c = getchar();
	while (c != EOF) {
	   putchar(c);
	   c = getchar();
	}
}


/*

* Why do we declare c an int, not a char?

* EOF is an integer (a symbolic constant) defined in <stdio.h>. EOF is Ctrl-D for Linux/Unix systems and Ctrl-Z for Windows systems.

* getchar() buffers input characters until a new line or EOF is entered, at which point if there is an output function executed, the buffer is written and then emptied.

* If the buffer is currently empty and EOF is entered, the program terminates.

 */



