标题:大师们,求围观!!!
取消只看楼主
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



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




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

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