> 其他 >
C语言输入三个整数,计算并输出它们的平均值
注意要用C语言,不是C++,不要用其它语句,
我是新手,要用基本数据的,刚学的scanf数据.
人气:328 ℃ 时间:2019-08-20 22:05:29
解答
#include
void main()
{
int a,b,c,d;
printf("Please input 3 numbers,example,[1,2,3]:\n");
scanf("%d,%d,%d",&a,&b,&c);
d=(a+b+c)/3;
printf("The average is %d.\n", d);
}
输入方式:
如1,2,3
则输出2
推荐
猜你喜欢
© 2024 79432.Com All Rights Reserved.
电脑版|手机版