我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

c语言“解一元二次方程”中遇到一个十分迷惑的问题

img


问题:在数学中当diat<0时,不应该直接输出“无解”就可以了吗,如果存在“输出两个复数解”这个解法,那么我应该输入什么代码?数学中的复数i直接出现在代码中不是会报错“未定义i”吗?

表示复数时,i 只是一个字符,不是变量。
这里有讨论解一元二次方程的c code:

math - C program to find out both real and complex roots for quadratic equation (ax^2 + bx + c = 0) - Stack Overflow This is the code I tried to get real and complex value for this equation, ax^2 + bx + c = 0. #include <math.h> #include <stdio.h> int main() { double a, b, c, d, x1, x2, i = sqrt(-... https://stackoverflow.com/questions/62910392/c-program-to-find-out-both-real-and-complex-roots-for-quadratic-equation-ax2

C program to find roots of a quadratic equation | Programming Simplified https://www.programmingsimplified.com/c/source-code/c-program-find-roots-of-quadratic-equation

C program to find all roots of a quadratic equation - Codeforwin Write a C program to find all roots of a quadratic equation using if else. Logic to find roots of quadratic equation in C programming. https://codeforwin.org/2016/04/c-program-to-find-all-roots-of-quadratic-equation.html

近期文章

  • Ubuntu未进入出现此问题,该怎么去解决这个问题
  • 可以说一下这个代码怎么写吗?卡壳了卡壳了
  • C++ 制作DLL 引用其它动态库、静态库 MT、MDD下STL内存释放问题
  • 前缀树的新结点(java数组问题)
  • querydsl 列名错误,@Column 不起作用
  • 请问如何在整张图片的下方批量添加文字?
  • python输出显示一部分正常一部分乱码
  • 刚进入Windows界面输入密码没有反应
  • 用vs2019运行代码时出现读取位置时发生的访问冲突
  • 对象资源管理器里啥都没有
  • 用汇编语言编写一个程序,该程序需要实现如下功能:
  • hadoop集群搭建,集群初始化
  • 关于#java#的问题,请各位专家解答!
  • TypeError: unsupported operand type(s) for +: 'int' and 'list'
  • C++类函数的参数的传递和隐式转换出现的问题
  • locust无头模式下生成的html无法显示图片
  • ASP.NET MVC中通过httpclient调用api和ajax直接调用API的区别?
  • C语言for循环逻辑问题
  • 这个判断左右括号输入是否正确的程序哪里错了
  • 微信小程序码怎么实现动态刷新(每访问一次,小程序码就更新一次)

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华