i need to find the sum of rounded to one number after the dot numbers(don't know the right way to call it)(1.63 = 1.6; 3.525=3.5 etc) in a txt file located in the same folder as my project. the numbers are wtitten through enter (new line = new number). i've got something, but it doesn't work properly. could you please check and help me finish the code.
double a, sum = 0.;
while (in >> a)
sum += round(a * 10.) / 10.;
else cout << "Unable to open file\n";
cout << "sum=" << sum << "\n";