首页
编程
java
php
前端
首页
编程
java
php
前端
c语言“解一元二次方程”中遇到一个十分迷惑的问题
问题:在数学中当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
点击展开全文