标题:已解决。不用进了谢谢。
取消只看楼主
allennay
Rank: 1
等 级:新手上路
帖 子:7
专家分:5
注 册:2017-10-12
结帖率:100%
 问题点数:0 回复次数:0 
已解决。不用进了谢谢。
代码如下
#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编辑过]

搜索更多相关主题的帖子: value printf enter If 显示 
2017-10-12 20:50



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-481335-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.674689 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved