第1个回答 2022-10-12
电脑上求三个数的平均值,怎么做
1、选中三个数值,点击公式--自动求和---平均值。
或者直接输入:=AVERAGE(A1:C1)
C语言,求三个数平均值
已改,看注释
#include
int main()
{
int a,b,c;
float average;
printf("input:");
scanf("%d%d%d",&a,&b,&c); 里面的\n去掉
printf("a=%d,b=%d,c=%d\n",a,b,c);
average=(a+b+c)/(float)3; 将3强制转换为float
printf("average=%f\n",average);
return 0;
}
已知一个数是三个数的平均值,怎么样用EXCEL算出那三个数?
这样的有无穷多个解
必须有其他的限定条件,比如知道其中2个,或者知道这些数字的范围,取值数量。。。。。
什么都不要求,基本上是没办法确定的。
c语言输入3个数 abc求平均值
#include int main(){ int a,b,c; scanf("%d%d%d", &a,&b,&c); printf("average of %d、%d and %d is %lf礌2;n", a, b, c, ((double)(a+b+c))/3); return 0;}
c语言,输入3个数求他们的平均值并输出,
#include
int main()
{
double a,b,c,sum;
printf("Enter three double:\n");
scanf("%d,%d,%d",&a,&b,&储);
sum=(a+b+c)/3;
printf("average=%lf\n",sum);
}
用C语言设计一个求三个数平均值的程序
#include
void main()
{
float a,b,c,v;
printf("please input three numbers:\n");
scanf("%f%f%f",&a,&b,&c);
v=(a+b+c)/3;
printf("%f\n",v);
getch();
}
跪求c语言编写输入任意的3个数求和与平均值讲解
#include“stdio.h礌
void main()
{
int a,b,c,sum;
float ave;
scanf("%d %d %d",&a,&b,&c);
sum=a+b+c;
ave=(a+b+c)/3.0;
printf("三个数的和为: %d\n",sum);
printf("三个数的平均值为: %f\n",ave);
}
讲解:
先定义四个整形
一个浮点型保存平均值
然后在控制台等待输入
将输入的三个整数加起来赋值给sum
将三个整形除以3.0(为什么是3.0,是因为ave是浮点型的,隐性转换到float)
然后输出
编写程序输入三个整数,求他们的平均值并输出。
#include
void main()
{
int a,b,c;
float average = 0;
printf("请输入3个整数:",&a,&b,&c);
scanf("%d %d %d",&a,&b,&c);
average = (a+b+c)/3.0f;
printf("\n平均值是:%f",average);
getchar(); 增加一行
getchar(); 增加一行
}