Si asa se poate. eu cel putin folosesc metoda asta.
while (scanf(%c", &x) > 0)
printf("%c", x);
http://www.cplusplus.com/reference/clibrary/cstdio/scanf.htmlReturn Value
On success, the function returns the number of items succesfully read. This count can match the expected number of readings or fewer, even zero, if a matching failure happens.
In the case of an input failure before any data could be successfully read, EOF is returned.