scanf, loop; finished single file way of coding