main.c: using fgets instead of scanf