selection by minimum in c plus plus with input file and output file