сделал вот так,но думаю это неправиль,подскажите как сложить элементы
Код: Выделить всё
#include<iostream.h>
#include<conio.h>
#include<stdlib.h>
#include<math.h>;
void main()
{int a[3][3];
int b[3];
int i,j;
randomize();
{for (i=0;i<3;i++)
{for (j=0;j<3;j++)
a[3][3]=random(10);
};
};
{for(i=0;i<3;i++)
{for (j=0;j<3;j++)
cout<<a[3][3]<<" ";
cout<<'\n';
}}
b[i]=0;
for(i=0;i<3;i++){
b[1]=sqrt(a[1][1])+sqrt(a[1][2])+sqrt(a[1][3]);
b[2]=sqrt(a[2][1])+sqrt(a[2][2])+sqrt(a[3][3]);
b[3]=sqrt(a[3][1])+sqrt(a[3][2])+sqrt(a[3][3]);
cout<<b[i]<<" ";
cout<<'\n';}
getch();
};