using sscanf in input instead of atof