include stdio include windows include iostream using namespace std voi

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#include <stdio.h>
#include <windows.h>
#include <iostream>
using namespace std;
void matrix_sort(int *pm, int size){
int flag = true;
int temp;
int i;
while(flag){
flag=false;
for(i=1; i<size; ++i){
if( *(pm+i) < *(pm+i-1) ){
temp = *(pm+i);
*(pm+i) = *(pm+i-1);
*(pm+i-1) = temp;
flag=true;
}
}
size--;
}
}
int main(){
int N[2][2] = {{2,1},{4,3}};
int M[3][3] = {{3,2,1},{6,5,4},{9,8,7}};
int mass_str[3];
int i,j;
cout << "Input fkn number, BEATCH!!!!" << endl;
for(i=0; i < 3; ++i){
cin >> mass_str[i];
}
for(i = 0 ; i < 3; ++i){
if(mass_str[i] < 2)
matrix_sort(&N[mass_str[i]][0], 2);
else
cout << "Pizdec ti tupoy!" << endl;
if(mass_str[i] < 3)
matrix_sort(&M[mass_str[i]][0], 3);
else
cout << "Pizdec ti tupoy!!" << endl;
}
cout << endl;
for(i = 0; i < 2; ++i){
for(j = 0; j < 2; ++j){
cout << N[i][j] << " ";
}
cout << endl;
}
cout << endl;
for(i = 0; i < 3; ++i){
for(j = 0; j < 3; ++j){
cout << M[i][j] << " ";
}
cout << endl;
}
return 0;
}