文章标题

来源:互联网 发布:程序员写博客写什么 编辑:程序博客网 时间:2024/06/05 00:08
#include <stdio.h>#include <stdlib.h>#include<math.h>int main(){    float a,b,c,x1,x2;    printf("从键盘上依次输入:a,b,c\n");    scanf("a=%f,b=%f,c=%f",&a,&b,&c);    x1=((b*(-1))+sqrt(b*b-4*a*c))/(2*a);    x2=((b*(-1))-sqrt(b*b-4*a*c))/(2*a);    printf("x1=%f,x2=%f\n",x1,x2);    return 0;}