#include<stdio.h> int main() { int a[8], *p; float *ave,sum=0;//sum用来求和 for(p=a;p<a+8;p++){ scanf("%d",p); sum+=*p;//累加每个元素值 } ave=&sum/8;//求平均值 printf("平均值:%g", *ave); }


原文地址: https://www.cveoy.top/t/topic/fnNL 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录