#include <iostream>
using namespace std;
int main()
{
const int a=5;
const int b=4;
int s[a][b]={{2,1,4,5},{1,2,4,6},{4,9,1,6},{4,6,2,7},{4,6,4,6}};
int m,h,j=0,max=0,sum=0,k=0;
cout<<"\ts1\ts2\ts3\ts4\tmax"<<endl;
cout<<"--------------------------------------------"<<endl;
for(m=0;m<a;m++)
{
cout<<"std#"<<m+1;
for(h=0;h<b;h++)
{cout<<"\t"<<s[m][h];
if(s[m][h]>max)
max=s[m][h];
}
cout<<"\t"<<max;
cout<<endl;
max-=max;
}
cout<<"--------------------------------------------"<<endl;
cout<<"sum"<<"\t";
for(k=0;k<b;k++)
{
for(int e=0;e<a;e++)
{
sum+=s[e][k];
}
cout<<sum<<"\t";
sum-=sum;
}
cout<<endl;
return 0;
يمكن يساعدك هذا البرنامج