#include
#include
#include
int main()
{
int i,a[10],b[10];
double c=0;
srand((unsigned)time(NULL));
printf("产生的随机数组是:\n");
for(i=0;i<10;i++)
{
a[i]=rand()%90+10;
printf(" %d ",a[i]);
c+=a[i];
}
c=c/10;
printf("\n新的数组为:\n");
int j = 0;
for (i = 0; i < 10; ++i)
{
if (a[i] < c)
{
b[j] = a[i];
printf(" %d ", b[j]);
++j;
}
}
getchar();
return 0;
}
//#include "stdafx.h"//vc++6.0加上这一行.
#include "stdio.h"
#include "time.h"
#include "stdlib.h"
void main(void){
int a[200],b[150],i,j;
double aver;
srand((unsigned)time(NULL));
for(aver=i=0;i<200;aver+=a[i++]=rand()%91+10);
for(aver/=200,j=i=0;i<200;i++)
if(a[i]
}
#include
#include
#include
void main()
{
int a[10],b[10],i,j,count=0,sum=0;
double avg;
srand(time(NULL));
for(i=0;i<10;i++)
{
a[i]=rand()%91+10;
sum+=a[i];
}
avg=(double)sum/10;
for(i=0,j=0;i<10;i++)
if(a[i]
b[j++]=a[i];
count++;
}
for(i=0;i
printf("\n");
}