| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 806 人关注过本帖
标题:已解决。不用进了谢谢。
只看楼主 加入收藏
allennay
Rank: 1
等 级:新手上路
帖 子:7
专家分:5
注 册:2017-10-12
结帖率:100%
收藏
 问题点数:0 回复次数:1 
已解决。不用进了谢谢。
代码如下
#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
吹水佬
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:451
帖 子:10539
专家分:42927
注 册:2014-5-20
收藏
得分:0 
截个运行结果图看看
2017-10-12 22:05
快速回复:已解决。不用进了谢谢。
数据加载中...
 
   



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

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