strcpy函数的实现
#include<stdio.h>#include<assert.h>#define N 100/* 实现查找一个数组小于平均值的所有元素 number为要查找的数组,n元素个数,store返回的数组, 函数返回小于平均值的个数*/int iFindSmallerNum(int number[],int n,int store[]){int i,j=0,sum = 0,ave;*store = *store;assert(n>0);for(i=0; i<n; i++)sum += number[i];ave = sum / n;for(i=0;i<n;i++){if(number[i]<ave)store[j++] = number[i];}return j;}int main(){int number[10] = {10,12,14,16,18,20,22,24,26,28};int store[N];int n,no = iFindSmallerNum(number,10,store);printf("%d\n",no);for(n = 0; n<no;n++)printf("%d\t",store[n]);return 0;}