hello guys. i cant count the sum of milk. Please help me.
#include<iostream>
using namespace std;
int main()
{
const int the_number_rows=4;
const int the_number_columns=8;
int i,j,sum;
int matrix[the_number_rows][the_number_columns];
cout<<"The taste test of flavour."<<endl;
cout<<"1=very poor"<<endl;
cout<<"2=poor"<<endl;
cout<<"3=average"<<endl;
cout<<"4=good"<<endl;
cout<<"5=very good"<<endl;
cout<<endl;
for(i=0 ; i<the_number_rows ;i++)
for(j=0; j<the_number_columns ; j++)
matrix[the_number_rows][the_number_columns]=0;
for( i=0 ; i<the_number_rows ; i++ )
1 2 3 4 5 6 7 8 9 10
|
{
{
cout<<"input scores for milk flavour "<<i+1-1<<" : ";
}
for( j=0 ; j<the_number_columns ; j++)
{
cin>>matrix[i][j];
}
}
|
cout<<endl;
for( i=0 ; i<the_number_rows ; i++ )
{
1 2 3 4 5 6 7 8 9
|
{
cout<<"\nMilk "<<i+1-1<<" "<<" : ";
sum=0;
}
for( j=0 ; j<the_number_columns ; j++)
{
sum=sum+matrix[0][j];
cout<<" "<<sum<<" ";
}
|
}
return 0;
}