#include<stdio.h>

#include<math.h>

int main()

{

double a,b,c,disc,x1,x2;

scanf("%lf%lf%lf",&a,&b,&c);

disc=b*b-4*a*c;

if(disc>0)

{

printf("方程有俩个不同的实数根\n");

printf("x1=%5.2f\n,x2=%5.2f\n",(-b/(2*a)+sqrt(disc))/(2*a),x2=(-b/(2*a)-sqrt(disc))/(2*a));

}

if(disc==0)

{

printf("有俩个相同的实数根\n");

printf("x1=x2=%5.2f\n",(-b+sqrt(disc))/(2*a));

}

else printf("方程无解");

return 0;

 

C语言初学 计算二元一次方程的问题的更多相关文章

  1. C语言初学 计算表达式的值 switch的意义

    #include<stdio.h> main() { int a; printf("请输入一个数字\n"); scanf("%d",&a); ...

  2. C语言初学 计算三角形面积问题

    #include<stdio.h> #include<math.h> #include<stdlib.h> int main() { float a,b,c,s,a ...

  3. Java基础_循环嵌套_打印乘法口诀、菱形,各种图形,计算二元一次和三元一次方程组_7

    循环嵌套 打印乘法口诀 for(int j=1;j<=9;j++){ for(int i=1;i<=j;i++){ System.out.print(i+"*"+j+& ...

  4. C语言中计算变量占用内存空间

    C语言中计算变量占用内存空间 在C语言中通常用[sizeof]运算符计算变量占内存空间,如下面的例子:

  5. 李洪强漫谈iOS开发[C语言-041]-计算月份天数

    李洪强漫谈iOS开发[C语言-041]-计算月份天数 

  6. 使用代数方程库 Algebra.js解二元一次方程

    假设二元一次方程如下: x + y = 11 x - y = 5 解方程如下: <!DOCTYPE html> <html lang="zh-CN"> &l ...

  7. 计算一元一次方程Y=kX+b

    开发过程中用不到一元一次方程吗?非也,iOS开发中经常会遇到根据某个ScrollView动态偏移量的值来实时设置一个View的透明度,你敢说你不用一元一次方程你能搞定? 想把一个动画效果做好,经常会遇 ...

  8. C 语言实例 - 计算标准偏差

    C 语言实例 - 计算标准偏差 计算标准偏差. 实例 #include <stdio.h> #include <math.h> float calculateSD(float ...

  9. C 语言实例 - 计算一个数的 n 次方

    C 语言实例 - 计算一个数的 n 次方 计算一个数的 n 次方,例如: ,其中 为基数, 为指数. 实例 - 使用 while #include <stdio.h> int main() ...

随机推荐

  1. 离线破win2003域账号密码(更新域数据库不在默认路径的情况)

    国内网站讲了许多方法,很多也讲得不清楚.我把我尝试成功的经验跟大家分享. 方法是按照tim的文章操作,链接如下: http://pauldotcom.com/2011/11/safely-dumpin ...

  2. xx通CGI流量控制

    流量控制共分2步,首先在CGI框架对用户的ip作限制,第二限制每个CGI的流量.   一.基于IP的流量控制 用共享内存(shm)的方式保存基于ip的访问信息. 配置文件中 <variable ...

  3. ionic android app 签名处理

    第一步:生成签名证书. y@y:my_temp$ $ keytool -genkey -v -keystore my-release-key.keystore -alias ydkt -keyalg ...

  4. Android之GPS应用开发

    LocationManager--------------->Context.LOCATION_SERVICE LocationProvider--------------->Locati ...

  5. HttpClient and FileUpload

    All communication over the Internet happens using a standard set of protocols, such as File Transfer ...

  6. Acdream a + b

    http://acdream.info/problem?pid=1007 两个 long long 相乘会超long long #include <cstdio> #include < ...

  7. Xamarin devexpress datagrid 样式

    DevExpress的提供光与暗的内置,可以应用到主题GridControl改变其外观.   主题 iOS版 Android版 光(默认适用于iOS) 黑暗(默认为Android) 应用预定义的主题 ...

  8. 【HDOJ】4541 Ten Googol

    打表的大水题. /* 4541 */ #include <cstdio> #include <cstdlib> #include <cstring> , , , } ...

  9. 总结:man, info, hwclock, cal, type, which, dirname, basename, who, which, whatis, makewhatis, hash, tty

    man, info, help, date, hwclock, cal, shutdown, reboot, halt, poweroff, type, cd, which, dirname, bas ...

  10. cf581D Three Logos

    Three companies decided to order a billboard with pictures of their logos. A billboard is a big squa ...