#include<stdio.h>
int f(int array[],int n,int result[2])
{
int i,sum=0,count=0;
for(i=0;i<n;i++)
if(array[i]>0)
{
sum+=array[i];
count++;
}
result[0]=sum;result[1]=count;
return result[2];
}
main()
{
int x[10],y[20],r[2],j;
printf("input array x:\n");
for(j=0;j<10;j++) scanf("%d",&x[j]);
printf("input array y:\n");
for(j=0;j<20;j++) scanf("%d",&y[j]);
int f(x[10],10,r[2]); /*函数调用*/
printf("The sum of x is:%d\nThere are positive number:%d\n",r[0],r[1]);
int f(y[20],20,r[2]); /*函数调用*/
printf("The sum of y is:%d\nThere are positive number:%d\n",r[0],r[1]);
}
德玛西亚99
翻过高山走不出你