标题:请帮忙看看这个 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



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




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

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