输入任意三个整数,求他们的平均值程序貌似没错,但是运行的结果为什么不对呢,我上传了截图 麻烦你们看看# include "stdio.h"void main(){int num1,num2,num3;float average;printf("please num1,num2,num3:\n");scanf("%d
来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/26 17:47:52
输入任意三个整数,求他们的平均值程序貌似没错,但是运行的结果为什么不对呢,我上传了截图 麻烦你们看看# include "stdio.h"void main(){int num1,num2,num3;float average;printf("please num1,num2,num3:\n");scanf("%d
输入任意三个整数,求他们的平均值
程序貌似没错,但是运行的结果为什么不对呢,我上传了截图 麻烦你们看看
# include "stdio.h"
void main()
{int num1,num2,num3;
float average;
printf("please num1,num2,num3:\n");
scanf("%d,%d,%d\n",&num1,&num2,&num3);
average = (num1+num2+num3)/3.0;
printf("%6.2f\n",average);
}
输入任意三个整数,求他们的平均值程序貌似没错,但是运行的结果为什么不对呢,我上传了截图 麻烦你们看看# include "stdio.h"void main(){int num1,num2,num3;float average;printf("please num1,num2,num3:\n");scanf("%d
int num1,num2,num3;
float average;
printf("please num1,num2,num3:\n");
scanf("%d,%d,%d",&num1,&num2,&num3);
average = (num1+num2+num3)/3.0;
printf("%6.2f\n",average);
//注:数字之后不要有空格