TOPIC

Wrong Answer 10% why please help me

Rezaul Karim asked 1 year ago

include include

using namespace std;

int main(){ double i,N,av,Num1,Num2,Num3,sum; cin>>N; for(i=0;i<N;i++){ cin>>Num1>>Num2>>Num3; sum = Num1+ Num2 + Num3; av = sum /3.0 ; cout.setf(ios::fixed,ios::floatfield); cout.precision(1); cout<<av<<endl; } return 0; }

This topic was solved and cannot recieve new replies.

  • guilherme otsu replied 1 year ago

    The exercise asks you to do weighted averages, and you are doing arithmetic mean.

    For this you have to multiply the notes by their weights and then add them all together, then divide by the sum of the weights.