ΠŸΠΎΠΌΠΎΡ‰ΡŒ Π² написании студСнчСских Ρ€Π°Π±ΠΎΡ‚
АнтистрСссовый сСрвис

ВСкст ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΡ‹. 
Π‘ΠΎΡ€Ρ‚ΠΈΡ€ΠΎΠ²ΠΊΠ° статичСских структур Π΄Π°Π½Π½Ρ‹Ρ…

Π Π΅Ρ„Π΅Ρ€Π°Ρ‚ΠŸΠΎΠΌΠΎΡ‰ΡŒ Π² Π½Π°ΠΏΠΈΡΠ°Π½ΠΈΠΈΠ£Π·Π½Π°Ρ‚ΡŒ ΡΡ‚ΠΎΠΈΠΌΠΎΡΡ‚ΡŒΠΌΠΎΠ΅ΠΉ Ρ€Π°Π±ΠΎΡ‚Ρ‹

Cout. width (3) ;//ΡˆΠΈΡ€ΠΈΠ½Π° поля Π²Ρ‹Π²ΠΎΠ΄ΠΈΠΌΠΎΠ³ΠΎ ΠΏΠ°Ρ€Π°ΠΌΠ΅Ρ‚Ρ€Π°. Cout. width (3) ;//ΡˆΠΈΡ€ΠΈΠ½Π° поля Π²Ρ‹Π²ΠΎΠ΄ΠΈΠΌΠΎΠ³ΠΎ ΠΏΠ°Ρ€Π°ΠΌΠ΅Ρ‚Ρ€Π°. Π’Ρ‹Π΄Π΅Π»Π΅Π½ΠΈΠ΅ динамичСской памяти ΠΏΠΎΠ΄ массива. Cout << «Π’Π²Π΅Π΄ΠΈΡ‚Π΅ Π΅Ρ‰Ρ‘ Ρ€Π°Π· для этой ячСйки» << endl; Рис 1 — сортировка ΠΊΠ²Π°Π΄Ρ€Π°Ρ‚Π½ΠΎΠΉ ΠΌΠ°Ρ‚Ρ€ΠΈΡ†Ρ‹. ΠžΠ±Π»Π°ΡΡ‚ΠΈ памяти, выдСляСмой ΠΏΠΎΠ΄ строку. На ΡΡ‚Ρ€ΠΎΠΊΠΈ присваиваСтся адрСс Π½Π°Ρ‡Π°Π»Π°. ОсвобоТдСниС динамичСской памяти. Void zanulenieElementov (tMatr a, bMatr b, int str… Π§ΠΈΡ‚Π°Ρ‚ΡŒ Π΅Ρ‰Ρ‘ >

ВСкст ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΡ‹. Π‘ΠΎΡ€Ρ‚ΠΈΡ€ΠΎΠ²ΠΊΠ° статичСских структур Π΄Π°Π½Π½Ρ‹Ρ… (Ρ€Π΅Ρ„Π΅Ρ€Π°Ρ‚, курсовая, Π΄ΠΈΠΏΠ»ΠΎΠΌ, ΠΊΠΎΠ½Ρ‚Ρ€ΠΎΠ»ΡŒΠ½Π°Ρ)

ВСкст ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΡ‹

//ΠœΠ΅Ρ‚ΠΎΠ΄Ρ‹ сортировки.

//ΠœΠ°ΡΡΠΈΠ²Ρ‹ динамичСскиС Π΄Π²ΡƒΠΌΠ΅Ρ€Π½Ρ‹Π΅.

//Π‘ΠΎΡ€Ρ‚ΠΈΡ€ΠΎΠ²ΠΊΠ° элСмСнтов всСх строк Π΄Π²ΡƒΠΌΠ΅Ρ€Π½ΠΎΠ³ΠΎ массива Ρ†Π΅Π»Ρ‹Ρ… чисСл.

//ΠΏΠΎ ΡƒΠ±Ρ‹Π²Π°Π½ΠΈΡŽ.

#include «iostream» .

#include «locale.h» .

#include.

using namespace std;

typedef bool boolVal; //ΠΎΠΏΡ€Π΅Π΄Π΅Π»Π΅Π½ΠΈΠ΅ Ρ‚ΠΈΠΏΠ° элСмСнтов массива.

typedef boolVal *bStr; //ΠΎΠΏΡ€Π΅Π΄Π΅Π»Π΅Π½ΠΈΠ΅ Ρ‚ΠΈΠΏΠ° «ΡƒΠΊΠ°Π·Π°Ρ‚Π΅Π»ΡŒ Π½Π° telem» .

typedef bStr *bMatr;

//ΠΎΠΏΡ€Π΅Π΄Π΅Π»Π΅Π½ΠΈΠ΅ Ρ‚ΠΈΠΏΠ° «ΡƒΠΊΠ°Π·Π°Ρ‚Π΅Π»ΡŒ Π½Π° ΡƒΠΊΠ°Π·Π°Ρ‚Π΅Π»ΡŒ Π½Π° telem» .

typedef int telem; //ΠΎΠΏΡ€Π΅Π΄Π΅Π»Π΅Π½ΠΈΠ΅ Ρ‚ΠΈΠΏΠ° элСмСнтов массива.

typedef telem *tStr; //ΠΎΠΏΡ€Π΅Π΄Π΅Π»Π΅Π½ΠΈΠ΅ Ρ‚ΠΈΠΏΠ° «ΡƒΠΊΠ°Π·Π°Ρ‚Π΅Π»ΡŒ Π½Π° telem» .

typedef tStr *tMatr;

//ΠΎΠΏΡ€Π΅Π΄Π΅Π»Π΅Π½ΠΈΠ΅ Ρ‚ΠΈΠΏΠ° «ΡƒΠΊΠ°Π·Π°Ρ‚Π΅Π»ΡŒ Π½Π° ΡƒΠΊΠ°Π·Π°Ρ‚Π΅Π»ΡŒ Π½Π° telem» .

int Color ();

void inputValMatr (bMatr a, int str, int sto);

void inputMatr (tMatr a, int str, int sto) ;

void handInput (tMatr a, int str, int sto) ;

void outputMatr (tMatr a, int str, int sto) ;

void sortVstavka (tMatr a, bMatr b, int str, int sto) ;

void zanulenieElementov (tMatr a, bMatr b, int str, int sto);

void outputBoolMatr (bMatr a, int str, int sto);

int main ().

{.

while (true).

{.

int i, j ;

int n = 0; //число строк ΠΌΠ°Ρ‚Ρ€ΠΈΡ†Ρ‹.

int m = 0; //число столбцов ΠΌΠ°Ρ‚Ρ€ΠΈΡ†Ρ‹.

bool y;

tMatr a; //ΠΎΠ±ΡŠΡΠ²Π»ΡΠ΅Ρ‚ΡΡ пСрСмСнная-ΡƒΠΊΠ°Π·Π°Ρ‚Π΅Π»ΡŒ Π½Π° ΡƒΠΊΠ°Π·Π°Ρ‚Π΅Π»ΡŒ Π½Π° telem.

bMatr b;

setlocale (LC_ALL," Russian") ;

cout < 3 (ΠŸΡ€ΠΈΠΌΠ΅Ρ€: 10 11): " ;

while (n < 3 && m < 3).

{.

cin.sync ();

try.

{.

char n1[3], m1[3];

cin >> n1 >> m1;

n = (int)atof (n1);

m = (int)atof (m1);

}.

catch (…).

{.

}.

cout << «ΠΠ΅Π²Π΅Ρ€Π½Ρ‹ΠΉ Π²Π²ΠΎΠ΄, Π½ΡƒΠΆΠ½ΠΎ число строк< 20» << endl;

}.

a = new tStr [n] ;

//Π²Ρ‹Π΄Π΅Π»Π΅Π½ΠΈΠ΅ динамичСской памяти ΠΏΠΎΠ΄ массива.

//ΡƒΠΊΠ°Π·Π°Ρ‚Π΅Π»Π΅ΠΉ Π½Π° ΡΡ‚Ρ€ΠΎΠΊΠΈ массива.

for (i = 0; i < n; i++) //Ρ†ΠΈΠΊΠ» выдСлСния памяти ΠΏΠΎΠ΄ ΠΊΠ°ΠΆΠ΄ΡƒΡŽ строку.

*(a + i) = new telem [m] ;//ΠΊΠ°ΠΆΠ΄ΠΎΠΌΡƒ элСмСнту массива ΡƒΠΊΠ°Π·Π°Ρ‚Π΅Π»Π΅ΠΉ.

//Π½Π° строки присваиваСтся адрСс Π½Π°Ρ‡Π°Π»Π°.

//области памяти, выдСляСмой ΠΏΠΎΠ΄ строку.

b = new bStr [n] ;

for (i = 0; i < n; i++).

*(b + i) = new boolVal [m] ;

cout << «Π’Π²Π΅Π΄ΠΈΡ‚Π΅ 0 — ΠΌΠ°Ρ‚Ρ€ΠΈΡ†Π° заполнится сама, Π²Π²Π΅Π΄ΠΈΡ‚Π΅ 1 ΠΈ Π²Π²ΠΎΠ΄ΠΈΡ‚Π΅ числа Ρ‡Π΅Ρ€Π΅Π· enter. «;

cin >> y;

if (!y).

{.

inputMatr (a, n, m) ;

}.

else.

{.

handInput (a, n, m);

}.

inputValMatr (b, n, m);

if (n <= 20).

{.

cout << «Π˜ΡΡ…одная ΠΌΠ°Ρ‚Ρ€ΠΈΡ†Π°: » ;

outputMatr (a, n, m) ;

sortVstavka (a, b, n, m);

cout << «ΠœΠ°Ρ‚Ρ€ΠΈΡ†Π° с ΠΎΡ‚сортированными строками: «<< endl ;

zanulenieElementov (a, b, n, m);

outputMatr (a, n, m) ;

}.

else.

{.

cout << «Π’Π°ΡˆΠ° ΠΌΠ°Ρ‚Ρ€ΠΈΡ†Π° ΠΠ• Π’Π›Π•Π—Π•Π’ Π² Π’Π°ΡˆΡƒ консоль ΠΏΠΎ ΡˆΠΈΡ€ΠΈΠ½Π΅» << endl;

return;

}.

cout << endl ;

//ОсвобоТдСниС динамичСской памяти.

for (i = 0; i < n; i++).

delete a[i] ;

delete a ;

char isExit =0;

cout << «Π’Π²Π΅Π΄ΠΈΡ‚Π΅ 1 для Π²Ρ‹Ρ…ΠΎΠ΄Π° «;

try.

{.

cin >> isExit;

if (isExit==1).

break;

}.

catch (…).

{.

}.

}.

}.

void inputMatr (tMatr a, int str, int sto).

{.

for (int i = 0; i < str; i++).

for (int j = 0; j < sto; j++).

*(*(a + i) + j) = (str*sto) — (i + j);

}.

void inputValMatr (bMatr a, int str, int sto).

{.

for (int i = 0; i < str; i++).

for (int j = 0; j < sto; j++).

*(*(a + i) + j) = false;

}.

void handInput (tMatr a, int str, int sto).

{.

int input = 0;

int *inputPointer = &input;

int *elemPointer;

for (int i = 0; i < str; i++).

{.

for (int j = 0; j < sto; j++).

{.

elemPointer = (*(a + i) + j);

*elemPointer = 0;

while (*elemPointer == 0).

{.

try.

{.

cin >> *inputPointer;

*elemPointer = (int)input;

}.

catch (…).

{.

cout << «Π’Π²Π΅Π΄ΠΈΡ‚Π΅ Π΅Ρ‰Ρ‘ Ρ€Π°Π· для этой ячСйки» << endl;

}.

}.

}.

}.

}.

//сортировка элСмСнтов массива ΠΏΠΎ Π²ΠΎΠ·Ρ€Π°ΡΡ‚Π°Π½ΠΈΡŽ ΠΌΠ΅Ρ‚ΠΎΠ΄ΠΎΠΌ вставки.

void sortVstavka (tMatr a, bMatr b, int str, int sto).

{.

telem *curElem = 0;

telem *nextElem = 0;

if ((str > 3) && (sto >3) && (str <= 20)).

{.

#pragma region |sto > str|.

//БоотвСтствСнно, Ссли количСство столбцов большС строк :

if (sto > str).

{.

telem curTemp;

int begSto = 0;

int begStr = 0;

int curStr=0;

double predelStr = 0;

double predelSto = 0;

//Π­Ρ‚ΠΎΡ‚ Ρ†ΠΈΠΊΠ» содСрТит 4 Ρ†ΠΈΠΊΠ»Π° выравнивания ΠΈ ΠΏΠΎΠ²Ρ‚оряСтся ΡΡ‚ΠΎΠ»ΡŒ;

//ΠΊΠΎ Ρ€Π°Π·, Ρ‡Ρ‚ΠΎΠ±Ρ‹ всС элСмСнты Π±Ρ‹Π»ΠΈ Π²Ρ‹Ρ€ΠΎΠ²Π½Π΅Π½Ρ‹ ΠΏΠΎ Π²ΠΎΠ·Ρ€Π°ΡΡ‚Π°Π½ΠΈΡŽ.

for (int l=0;l<=((str/2)-sto+str+1);l++).

{.

begSto = 1;

  • (sto/2 == 0)? predelSto = sto/2: predelSto = (sto/2)-1;
  • (str/2==0)? begStr = (str/2)+1: begStr = (str/2);

predelStr = begStr+1;

//1-ΠΉ Ρ†ΠΈΠΊΠ» выравнивания.

for (int curSto = begSto;

curSto <= predelSto; curSto++).

{.

curStr = begStr;

if (predelStr >0).

predelStr—;

while (curStr >= predelStr).

{.

boolVal *curBool = (*(b + curStr) + curSto);

boolVal *nextBool = (*(b + curStr — 1) + curSto);

curElem = (*(a + curStr) + curSto);

curTemp = *curElem;

if (curStr>0).

nextElem =.

(*(a + curStr — 1) +curSto);

if ((*curElem > *nextElem) && curStr > 0).

{.

  • *curElem = *nextElem;
  • *nextElem = curTemp;

}.

*curBool = true;

if (((curStr-1) >= 0) &&.

((curStr+1)<=str-1)).

{.

*nextBool = true;

}.

curStr—;

if ((curSto > (sto/2 + 1))).

break;

}.

}.

begSto = (sto-2);

predelStr = begStr+1;

//2-ΠΉ Ρ†ΠΈΠΊΠ» выравнивания.

for (int curSto = begSto; curSto > predelSto; curSto—).

{.

curStr = begStr;

if (predelStr >0).

predelStr—;

while (curStr >= predelStr).

{.

boolVal *curBool =.

(*(b + curStr) + curSto);

boolVal *nextBool =.

(*(b + curStr — 1) + curSto);

curElem = (*(a + curStr) + curSto);

curTemp = *curElem;

if (curStr>0).

nextElem =.

(*(a + curStr — 1) + curSto);

if ((*curElem > *nextElem) && curStr > 0).

{.

  • *curElem = *nextElem;
  • *nextElem = curTemp;

}.

*curBool = true;

if (((curStr-1) >= 0) &&.

((curStr+1)<=str-1)).

{.

*nextBool = true;

}.

curStr—;

if ((curSto < (sto/2 — 1))).

break;

}.

}.

(str/2==0)? begStr = (str/2): begStr = (str/2)+0.5;

predelStr = begStr;

//3-ΠΉ Ρ†ΠΈΠΊΠ» выравнивания.

for (int curSto = 1; curSto <= predelSto; curSto++).

{.

curStr = begStr+1;

if (predelStr < str-1).

predelStr++;

while (curStr <= predelStr).

{.

boolVal *curBool =.

(*(b + curStr) + curSto);

boolVal *nextBool =.

(*(b + curStr + 1).

+ curSto);

curElem =.

(*(a + curStr) + curSto);

curTemp =.

*curElem;

if (curStr<(str-1)).

nextElem =.

(*(a + curStr + 1) + curSto);

if ((*curElem > *nextElem).

&& curStr < str-1).

{.

  • *curElem = *nextElem;
  • *nextElem = curTemp;

}.

*curBool = true;

curStr++;

if ((curSto > (sto/2 + 1))).

break;

}.

}.

predelStr = begStr;

//4-ΠΉ Ρ†ΠΈΠΊΠ» выравнивания.

for (int curSto = sto-2;

curSto > predelSto; curSto—).

{.

curStr = begStr+1;

if (predelStr < str-1).

predelStr++;

while (curStr <= predelStr).

{.

boolVal *curBool =.

(*(b + curStr) + curSto);

boolVal *nextBool =.

(*(b + curStr + 1) + curSto);

curElem = (*(a + curStr) + curSto);

curTemp = *curElem;

if (curStr<(str-1)).

nextElem =.

(*(a + curStr + 1) +.

curSto);

if ((*curElem > *nextElem)&&.

curStr < (str-1)).

{.

  • *curElem = *nextElem;
  • *nextElem = curTemp;

}.

*curBool = true;

curStr++;

if ((curSto < ((sto/2 — 1)))).

break;

}.

}.

}.

}.

#pragma endregion.

#pragma region |sto < str|.

if (sto < str).

{.

telem curTemp;

int begSto = 0;

int begStr;

if (str % 2 == 0).

begStr = (str / 2) — 1;

else.

begStr = (str / 2);

for (int l=0;l<=((str/2)-sto+str+1);l++).

{.

int curStr=begStr;

double predelSto;

double predelStr = 0;

predelSto = sto/2−1;

predelStr = begStr+1;

begSto = 0;

//1.

for (int curSto = begSto;

curSto <= predelSto; curSto++).

{.

curStr = begStr;

if (predelStr >1).

predelStr—;;

while (curStr >= predelStr).

{.

boolVal *curBool =.

(*(b + curStr) + curSto);

curElem = (*(a + curStr) + curSto);

curTemp = *curElem;

if (curStr<(str-1)).

nextElem =.

(*(a + curStr — 1) + curSto);

if ((*curElem > *nextElem) &&.

curStr <(str-1)).

{.

  • *curElem = *nextElem;
  • *nextElem = curTemp;

}.

*curBool = true;

curStr—;

}.

}.

//2-ΠΉ Ρ†ΠΈΠΊΠ» выравнивания.

predelStr = begStr+1;for (int curSto = sto-1;

curSto > predelSto; curSto—).

{.

curStr = begStr;

if (predelStr > 1).

predelStr—;

while (curStr >= predelStr).

{.

boolVal *curBool =.

(*(b + curStr) + curSto);

curElem = (*(a + curStr) + curSto);

curTemp = *curElem;

if (curStr<(str-1)).

nextElem =.

(*(a + curStr — 1) + curSto);

if ((*curElem > *nextElem) &&.

curStr <(str-1)).

{.

  • *curElem = *nextElem;
  • *nextElem = curTemp;

}.

*curBool = true;

curStr—;

}.

}.

//3-ΠΉ Ρ†ΠΈΠΊΠ» выравнивания.

if (str % 2 == 0).

begStr = (str / 2);

else.

begStr = (str / 2);

begSto = 0;

predelStr = begStr-1;

for (int curSto = begSto;

curSto <= predelSto; curSto++).

{.

curStr = begStr;

if (predelStr < (str-1)).

predelStr++;;

while (curStr <= predelStr).

{.

boolVal *curBool =.

(*(b + curStr) + curSto);

curElem = (*(a + curStr) + curSto);

curTemp = *curElem;

if (curStr<(str-1)).

nextElem =.

(*(a + curStr + 1) + curSto);

if ((*curElem > *nextElem) &&.

curStr < (str-1)).

{.

  • *curElem = *nextElem;
  • *nextElem = curTemp;

}.

*curBool = true;

curStr++;

}.

}.

//4-ΠΉ Ρ†ΠΈΠΊΠ» выравнивания.

predelStr = begStr-1;

for (int curSto = sto-1;

curSto > predelSto; curSto—).

{.

curStr = begStr;

if (predelStr < (str-1)).

predelStr++;

while (curStr <= predelStr).

{.

boolVal *curBool =.

(*(b + curStr) + curSto);

curElem = (*(a + curStr) + curSto);

curTemp = *curElem;

if (curStr<(str-1)).

nextElem =.

(*(a + curStr + 1) + curSto);

if ((*curElem > *nextElem) &&.

curStr < (str-1)).

{.

  • *curElem = *nextElem;
  • *nextElem = curTemp;

}.

*curBool = true;

curStr++;

}.

}.

}.

}.

#pragma endregion.

#pragma region |sto == str|.

if (sto == str).

{.

telem curTemp;

for (int l=0;l<=((str/2)-sto+str+1);l++).

{.

int begSto = 0;

int begStr = 0;

int curStr=begStr;

double predelSto = 0;

double predelStr = 0;

begSto = 0;

if (str % 2 == 0).

begStr = (str / 2) — 1;

else.

begStr = (str / 2);

(sto/2 == 0)? predelSto = sto/2 :

predelSto = (sto/2)+0.5;

predelStr = begStr+1;

for (int curSto = begSto;

curSto <= predelSto; curSto++).

{.

curStr = begStr;

if (predelStr >0).

predelStr—;

while (curStr >= predelStr).

{.

boolVal *curBool =.

(*(b + curStr) + curSto);

boolVal *nextBool =.

(*(b + curStr — 1) + curSto);

curElem = (*(a + curStr) + curSto);

curTemp = *curElem;

if (curStr>0).

nextElem =.

(*(a + curStr — 1) + curSto);

if ((*curElem > *nextElem) &&.

curStr > 0).

{.

  • *curElem = *nextElem;
  • *nextElem = curTemp;

}.

*curBool = true;

curStr—;

}.

}.

//2-ΠΉ Ρ†ΠΈΠΊΠ» выравнивания.

predelStr = begStr+1;

for (int curSto = sto-1;

curSto > predelSto; curSto—).

{.

curStr = begStr;

if (predelStr > 0).

predelStr—;

while (curStr >= predelStr).

{.

boolVal *curBool =.

(*(b + curStr) + curSto);

boolVal *nextBool =.

(*(b + curStr — 1) + curSto);

curElem = (*(a + curStr) + curSto);

curTemp = *curElem;

if (curStr>0).

nextElem = (*(a + curStr — 1) +.

curSto);

if ((*curElem > *nextElem) &&.

curStr > 0).

{.

  • *curElem = *nextElem;
  • *nextElem = curTemp;

}.

*curBool = true;

curStr—;

}.

}.

if (str % 2 == 0).

{.

begStr = (str / 2);

begSto = sto-1;

}.

else.

{.

begStr = (str / 2)+1;

begSto = sto-2;

}.

predelStr = begStr-1;

//3-ΠΉ Ρ†ΠΈΠΊΠ» выравнивания.

for (int curSto = begSto; curSto >= predelSto; curSto—).

{.

curStr = begStr;

if (predelStr < (str-1)).

predelStr++;

while (curStr <= predelStr).

{.

boolVal *curBool =.

(*(b + curStr) + curSto);

boolVal *nextBool =.

(*(b + curStr + 1) + curSto);

curElem = (*(a + curStr) + curSto);

curTemp = *curElem;

if (curStr<(str-1)).

nextElem = (*(a + curStr + 1) + curSto);

if ((*curElem > *nextElem) &&.

curStr < (str-1)).

{.

  • *curElem = *nextElem;
  • *nextElem = curTemp;

}.

*curBool = true;

curStr++;

}.

}.

if (str % 2 == 0).

{.

begStr = (str / 2);

begSto = 0;

}.

else.

{.

begStr = (str / 2)+1;

begSto = 1;

}.

predelStr = begStr-1;

//4-ΠΉ Ρ†ΠΈΠΊΠ» выравнивания.

for (int curSto = begSto;

curSto < predelSto; curSto++).

{.

curStr = begStr;

if (predelStr < (str-1)).

predelStr++;

while (curStr <= predelStr).

{.

boolVal *curBool =.

(*(b + curStr) + curSto);

boolVal *nextBool =.

(*(b + curStr + 1) + curSto);

curElem = (*(a + curStr) + curSto);

curTemp = *curElem;

if (curStr<(str-1)).

nextElem =.

(*(a + curStr + 1) + curSto);

if ((*curElem > *nextElem) &&.

curStr < (str-1)).

{.

  • *curElem = *nextElem;
  • *nextElem = curTemp;

}.

*curBool = true;

curStr++;

}.

}.

}.

}.

#pragma endregion.

}.

if ((str == 3) && (sto == 3)).

{.

int var = 0;

int *one = (*(a + 1) + 1);

int *two = (*(a + 0) + 1);

if (one > two).

{.

var = *one;

  • *one = *two;
  • *two = var;

}.

}.

}.

void zanulenieElementov (tMatr a, bMatr b, int str, int sto).

{.

for (int stro = 0; stro <= (str -1); stro++).

{.

for (int stol = 0; stol <= (sto -1); stol++).

{.

if (*(*(b + stro) + stol) == false).

{.

*(*(a + stro) + stol) = 0;

}.

}.

}.

}.

void outputMatr (tMatr a, int str, int sto).

{ int i, j ;

for (i = 0; i < str; i++).

{for (j = 0; j < sto; j++).

{cout.width (3) ;//ΡˆΠΈΡ€ΠΈΠ½Π° поля Π²Ρ‹Π²ΠΎΠ΄ΠΈΠΌΠΎΠ³ΠΎ ΠΏΠ°Ρ€Π°ΠΌΠ΅Ρ‚Ρ€Π°.

cout << *(*(a + i) + j) << ' ' ;

}.

cout << ««;

}.

}.

void outputBoolMatr (bMatr a, int str, int sto).

{ int i, j ;

for (i = 0; i < str; i++).

{for (j = 0; j < sto; j++).

{cout.width (3) ;//ΡˆΠΈΡ€ΠΈΠ½Π° поля Π²Ρ‹Π²ΠΎΠ΄ΠΈΠΌΠΎΠ³ΠΎ ΠΏΠ°Ρ€Π°ΠΌΠ΅Ρ‚Ρ€Π°.

cout << *(*(a + i) + j) << ' ' ;

}.

cout << ««;

}.

}.

Π Π΅Π·ΡƒΠ»ΡŒΡ‚Π°Ρ‚Ρ‹ тСстирования

Рис 1 — ΡΠΎΡ€Ρ‚ΠΈΡ€ΠΎΠ²ΠΊΠ° ΠΊΠ²Π°Π΄Ρ€Π°Ρ‚Π½ΠΎΠΉ ΠΌΠ°Ρ‚Ρ€ΠΈΡ†Ρ‹

Рис 2 — ΡΠΎΡ€Ρ‚ΠΈΡ€ΠΎΠ²ΠΊΠ° ΠΏΡ€ΡΠΌΠΎΡƒΠ³ΠΎΠ»ΡŒΠ½ΠΎΠΉ ΠΌΠ°Ρ‚Ρ€ΠΈΡ†Ρ‹ #1

сортировка ΠΏΡ€ΡΠΌΠΎΡƒΠ³ΠΎΠ»ΡŒΠ½ΠΎΠΉ ΠΌΠ°Ρ‚Ρ€ΠΈΡ†Ρ‹ #1.
ВСкст ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΡ‹. Π‘ΠΎΡ€Ρ‚ΠΈΡ€ΠΎΠ²ΠΊΠ° статичСских структур Π΄Π°Π½Π½Ρ‹Ρ….

Рис 3 — ΡΠΎΡ€Ρ‚ΠΈΡ€ΠΎΠ²ΠΊΠ° ΠΏΡ€ΡΠΌΠΎΡƒΠ³ΠΎΠ»ΡŒΠ½ΠΎΠΉ ΠΌΠ°Ρ‚Ρ€ΠΈΡ†Ρ‹ #1

сортировка Π΄Π°Π½Π½Ρ‹Π΅ ΠΌΠ°Ρ‚Ρ€ΠΈΡ†Π°.

Π²Ρ‹Π²ΠΎΠ΄ увСдомлСния ΠΎ Π½Π΅ΠΏΡ€Π°Π²ΠΈΠ»ΡŒΠ½ΠΎΡΡ‚ΠΈ Π²Π²ΠΎΠ΄Π° Π΄Π°Π½Π½Ρ‹Ρ….

Рисунок 4 — Π²Ρ‹Π²ΠΎΠ΄ увСдомлСния ΠΎ Π½Π΅ΠΏΡ€Π°Π²ΠΈΠ»ΡŒΠ½ΠΎΡΡ‚ΠΈ Π²Π²ΠΎΠ΄Π° Π΄Π°Π½Π½Ρ‹Ρ….

ΠŸΠΎΠΊΠ°Π·Π°Ρ‚ΡŒ вСсь тСкст
Π—Π°ΠΏΠΎΠ»Π½ΠΈΡ‚ΡŒ Ρ„ΠΎΡ€ΠΌΡƒ Ρ‚Π΅ΠΊΡƒΡ‰Π΅ΠΉ Ρ€Π°Π±ΠΎΡ‚ΠΎΠΉ