include stdio include stdlib void input int massiv int int for massiv

 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
#include <stdio.h>
#include <stdlib.h>
void input(int*massiv,int n)
{
int i;
for (i=0;i<n;++i)
*(massiv+i)=rand()%51-25;
}
void change(int *mass,int n,int m,int c)
{
int i,j,t;
for (i=0;i<n-1;++i)
{
if((*(mass+i*m+c))<(*(mass+i*(m+1)+c)));
{
printf ("dsada\n");
t=*(mass+i*m+c);
*(mass+(i*m)+c)=*(mass+(i*(m+1))+c);
*(mass+i * (m+1)+c)=t;
}
printf ("\n");
}
}
void output(int *mass,int n,int m)
{
printf(" Massiv:\n");
int i,j;
for (i=0; i<n; ++i)
{
for (j=0;j<m;++j)
printf("%d\t",*(mass+i*m+j));
printf ("\n");
}
}
int main()
{
int a[7][9],b[9][5],co;
//input(&b[0][0],9*5);
input(&a[0][0],7*9);
//output(&b[0][0],9,5);
output(&a[0][0],7,9);
printf("\nWhich column sort: ");
scanf("%d",&co);
//change(&b[0][0],9,5,c);
change(&a[0][0],7,9,co);
printf("\n\tFinal\n\n");
//output(&b[0][0],9,5);
output(&a[0][0],7,9);
}