| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 442 人关注过本帖
标题:请帮忙看看这个 C 程序哪儿写错了!!!!!!!!
只看楼主 加入收藏
zy_956
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2014-10-20
结帖率:0
收藏
已结贴  问题点数:20 回复次数:3 
请帮忙看看这个 C 程序哪儿写错了!!!!!!!!
请问各位大侠,下面的程序那里有问题?
#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 $%.2f.\n",value);
    printf("You are easily worch that! If rhodium prices drop.\n");
    printf("eat more to maintain your value.\n);
    getchar();
    getchar();
}
这些事错误提示
E:\C\C-3\C-3-1\C3-1.c(10) : warning C4244: '=' : conversion from 'double ' to 'float ', possible loss of data
E:\C\C-3\C-3-1\C3-1.c(13) : error C2001: newline in constant
E:\C\C-3\C-3-1\C3-1.c(14) : error C2064: term does not evaluate to a function
E:\C\C-3\C-3-1\C3-1.c(14) : warning C4047: 'function' : 'const char *' differs in levels of indirection from 'int '
E:\C\C-3\C-3-1\C3-1.c(14) : warning C4024: 'printf' : different types for formal and actual parameter 1
E:\C\C-3\C-3-1\C3-1.c(14) : error C2143: syntax error : missing ')' before ';'
执行 cl.exe 时出错.
  膜拜了
搜索更多相关主题的帖子: maintain include please easily 
2014-11-12 23:18
zy_956
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2014-10-20
收藏
得分: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 $%.2f.\n",value);
    printf("You are easily worch that! If rhodium prices drop.\n");
    printf("eat more to maintain your value.\n);
    getchar();
    getchar();
}
2014-11-12 23:43
espier
Rank: 2
等 级:论坛游民
帖 子:8
专家分:85
注 册:2014-11-12
收藏
得分:20 
    printf("eat more to maintain your value.\n"/*这里没有双引*/);
    getchar();
    getchar();
}
2014-11-13 00:58
zy_956
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2014-10-20
收藏
得分:0 
多谢了啊
2014-11-13 11:50
快速回复:请帮忙看看这个 C 程序哪儿写错了!!!!!!!!
数据加载中...
 
   



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

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