while ( (rainbow) && (calculated < numInput) ) { calculated++; rainbow.ignore(200, '\n'); // Skip to next line of input heightMain = double(distance * tan(MainAngle * pi / 180)); heightSecondary = double(distance * tan(SecondaryAngle * pi / 180)); heights << setw(4) << setprecision(4) << heightMain; heights << setw(13) << setprecision(4) << heightSecondary; heights << setw(14) << setprecision(4) << distance; rainbow >> distance; }