include stdio include stdlib define define int main int argc char argv

 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
#include <stdio.h>
#include <stdlib.h>
#define N 3
#define M 2
int main(int argc, char *argv[]) {
int P[N][M];
int i,j,k1,k2;
printf ("Vvedite massive:");
for (i=0;i<N;i++)
for (j=0;j<M;j++)
scanf("%d", &P[i][j]);
do
{
printf("k1=");
scanf("%d",&k1);
}
while(k1<0 && k1<M);
do
{
printf("k2=");
scanf("%d",&k2);
}
while(k2<0 && k2<M);
for (i=0;i<N;i++)
P[i][k1]+=P[i][k2];
printf ("Polychim massive:\n");
for (i=0;i<N;i++)
for (j=0;j<M;j++)
printf("%5.1d\n", P[i][j]);
printf("\n");
system("PAUSE");
return 0;
}