#include
#define N 80
int input(int *arr)
{
int *pnew=arr;
int count=0;
printf("请输入整型数据(按q/Q退出:)\n");
while(1==scanf("%d",pnew)&&pnew
count++;
pnew++;
}
printf("输入数据完毕!\n");
return count;
}
void show(int *arr,int n)
{
int *p;
for(p=arr;p
printf("\n");
return;
}
long sum(int *arr,int n)
{
long s=0;
int *p=arr;
while (p
s+=*p++;
}
return s;
}
int max(int *arr,int n)
{
int m=*arr;
int *p;
for(p=arr;p
if (m<*p)
m=*p;
}
return m;
}
int main(void)
{
int a[N],n;
n=input(a);
show(a,n);
printf("数组元素之和是%ld\n",sum(a,n));
printf("最大元素值是%d\n",max(a,n));
return 0;
}