include stdio include stdlib include math define int main int argc cha

 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
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define N 5
int main(int argc, char *argv[]) {
int p[N];
int i,sum,sr,k;
sum=0; k=0;
printf("Vvedite massive\n");
for (i=0;i<N;i++)
{
scanf("%d", &p[i]);
sum+=p[i];
}
sr=sum/N;
printf(" sum= %d ",sum);
for (i=0;i<N;i++)
{if (abs(p[i]-sr)<=1)
k=k+1;
}
printf(" k= %d ",k);
system ("PAUSE");
return 0;
}