wloving


私信TA

用户名:wloving

访问量:960

签 名:

万物皆虚,万事皆允。

等  级
排  名 5030
经  验 1540
参赛次数 1
文章发表 2
年  龄 0
在职情况 在职
学  校
专  业

  自我简介:

 

0.0分

2 人评分

看不懂代码?想转换其他语言的代码? 或者想问其他问题? 试试问问AI编程助手,随时响应你的问题:

编程语言转换

万能编程问答  

代码解释器

代码纠错

SQL生成与解释

  评论区

#include<iostream>
#include<cmath>
#include<iomanip>
using namespace std;double x1, x2, q,p,m;
void s1(double a, double b, double c) {
		x1 = (-b + sqrt(m)) / 2 * a;
		x2 = (-b - sqrt(m)) / 2 * a;
		cout << x1 << " " << x2 << endl;
}
void s2(double a,double b,double c){
		x1 = x2 = (-b) / (2 * a);
		cout << x1 << " " << x2 << endl;
}
void s3(double a,double b,double c){
		q = (-b) / (2 * a);
		p = sqrt(-m) / (2 * a);
		cout << "x1=" << q << "+" << fixed << setprecision(3) << p << "i" << " " << "x2 =" << q << "-" << fixed << setprecision(3) << p << "i" << endl;
}
int main()
{
	double a, b, c;
2022-08-04 22:39:57
  • «
  • 1
  • »