||. || || ++.
, . . ', . ++ ' ( ).
' .
|| ' ', , . ʳ , |,| , .
|| ++ - , (||).
. . || .
#include <iostream. h>
#include <conio. h>
#define Row 5
#define Col 4
void main ()
{float mas[Row][Col], // mas, Row*Col // float
float m_o = 0, m_o_2=0; int i, j;
for (i = 0; i < Row, i ++)
for (j = 0; j < Col, j ++)
{cin >> mas[i][j]; //
m_o + = mas[i][j]; //
m_o_2+=mas[i][j]*mas[i] [j];//
}
m_o = m_o / (Col*Row); // . /
out << \n = << m_o;
m_o_2 = m_o_2 / (Col*Row); //
cout << \ n = << m__2 - m_*m_0;
getch();
}
' . ++ new delete ||:
_ = new _ [_];
delete [] _;
_ :
_ * _;
|| ( ') '|| ', new, _ || NULL.
' || new || ' ( ). . || , || .
. , .
#include < iostream. h >
void main()
|
|
{ int row, col, i, j, pos;
cout << ¢¢ \n ¢¢;
cin >> row>>col;
int ** mas;
mas = new int * [row]; //
for (i = 0; i < row; i ++)
{ mas [i] = new int [col]; /* i -
*/
for (j = 0; j < col; j ++)
cin >> mas [i] [j]; //
}
for (i = 0; i < row; i ++)
{ pos = -1;
for (j = 0; j < col; j ++)
if (mas [i][j] = = 0) break;
pos = j; /*
, pos*/
if (pos <col) cout << ¢¢ \ n ¢¢ <<i<<¢¢ - ¢¢
<<pos<< ¢¢ ¢¢;
else cout << ¢¢ \n ¢¢ <<i<< ¢¢ ¢¢;
}
for(i=0;i<col;i++) delete[] mas[i]; /* , i- */
delete[] mas; // ,
}