topic:
3 integer input, outputs their average value, three decimal places.
Ideas:
It can be calculated directly.
Code:
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
int a = 0, b = 0, c = 0;
cin >> a >> b >> c;
double average = static_cast<double >(a + b + c) / 3;
cout << setprecision(3) << fixed << average << endl;
return 0;
}