大家下午好,我这能输出小数,但不能计算,求各位帮我看看
#include<stdio.h>#define g 10
int calculate(int Mass);
int main()
{
int m_Mass;
int gravity;
float Mass;
printf("请输入物体的质量:\n");
scanf("%d",&m_Mass);
gravity=calculate(m_Mass);
printf("物体的重力为:");
printf("%d\n",gravity);
return 0;
}
int calculate(int Mass)
{
int gravity=Mass*g;
return gravity;
}