#include<stdio.h>
int main()
{
int sum=0;
int count=0;
int number;
scanf("%d",&number);
while(number!=-1){
sum+=number;
count++;
scanf("%d",&number);
}
printf("%f",1.0*sum/count);
return 0;
}
2023-12-03 16:47:04
#include<stdio.h>
int main()
{
int sum=0;
int count=0;
int number;
scanf("%d",&number);
while(number!=-1){
sum+=number;
count++;
scanf("%d",&number);
}
printf("%f",1.0*sum/count);
return 0;
}
下一篇:【MySQL】表的操作