源程序:
#include <stdlib.h>
#include <stdio.h>
main()
{
int a[5];
int i;
int count=0,sum=0;
printf("Please input 5 number: \n");
for(i=0;i<5;i++)
{
scanf("%d",&a[i]);
if(a[i]>0)
{
count++;
sum+=a[i];
}
}
printf("The positive number is:%d \n",count);
printf("The sum=:%d \n",sum);
}