yes,i can use scanf(). but i don't know much about the function in C. In UVA, the most input is terminated by End Of File. when i use stream, cin will throw an exception when it read EOF, i use
[cpp] while (cin >> a)[/cpp] to find the End Of File.
If i use scanf(), how should i write
[c]while ...