已解决。不用进了谢谢。
代码如下#include<stdio.h>
int main(void)
{
float weight;
float value;
printf("Are you worth your weight in rhodium?\n");
printf("Let's check it out.\n");
printf("Please enter your weight in pounds:");
scanf("%f", &weight);
value = 770 * weight * 14.5833;
printf("Your weight in rhodium is worth $%.2f.\n",value);
printf("You are easily worth that! If rhodium prices drop,\n");
printf("eat more to maintain your value.\n");
return 0;
}
输出显示如下。
Are you worth your weight in rhodium/
Let's check it out.
Please enter your weight in pounds:150
Your weight in rhodium is worth $0.00.
,valueYou are easily worth that! If rhodium prices drop,
eat more to maintain your value.
在程序中输入数字150.正常情况下会显示 worth $1684371.12.而我这个无论输入什么数字都只显示 worth $0.00.
请大神解答下。不胜感激。
[此贴子已经被作者于2017-10-12 21:01编辑过]