| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 647 人关注过本帖
标题:大师们,求围观!!!
取消只看楼主 加入收藏
lbt001
Rank: 1
等 级:新手上路
帖 子:26
专家分:4
注 册:2015-2-3
结帖率:62.5%
收藏
已结贴  问题点数:20 回复次数:0 
大师们,求围观!!!
local variable 'b' used without having been initialized
 local variable 'a' used without having been initialzed
 warning C4700: local variable 'c' used without having been initialized
我的程序一直是输出“无解”
# include <stdio.h>
# include <math.h>
int main(void)
{
    double a,b,c;
    double x1,x2;
    double delta;
   
    printf("请输入三个数值\n");
    delta = b * b - 4 * a * c ;
    printf("a = ");
    scanf("%lf",&a);
    printf("b = ");
    scanf("%lf",&b);
    printf("c = ");
    scanf("%lf",&c);
    do
    {
    if(delta > 0)
    {
        x1 = (-b+sqrt(delta))/(2*a);
        x2 = (-b-sqrt(delta))/(2*a);
        printf("x1= %lf,x2 = %lf\n",x1,x2);

    }
    if(delta == 0)
    {
        x1 = (-b)/(2*a);
        x2 = x1;
        printf("x1 = x2 =%lf\n");


    }
    else if(delta < 0)
    {

        printf("无解\n");

    }
    }while(1);


    return 0;
}
搜索更多相关主题的帖子: include warning without double having 
2015-02-16 22:10
快速回复:大师们,求围观!!!
数据加载中...
 
   



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

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