#include<stdio.h> int main(void) { int n,m,i,sum; double average; printf("Enter m:"); scanf("%d",&m); for(i=1;i<=m;i++){//以此来输入n个学生的成绩 printf("Enter n:"); scanf("%d",&n); sum=n+n; } average=(sum)/m; printf("average=%lf",average); return 0; }
#include<stdio.h> int main(void) { int n,m,i,sum; double average; printf("Enter m:"); scanf("%d",&m); for(i=1;i<=m;i++){//以此来输入n个学生的成绩 printf("Enter n:"); scanf("%d",&n); sum=n+n; } average=(sum)/m; printf("average=%lf",average); return 0; }