首页
DreamJudge
院校信息
考研初试
机试真题
讨论区
兑换中心
登录
注册
上岸
以下题解仅供学习参考使用。
抄袭、复制题解,以达到刷AC率/AC数量或其他目的的行为,在N诺是严格禁止的。
N诺非常重视学术诚信。此类行为将会导致您成为作弊者。具体细则请查看N诺社区规则。
wwj0102
2025年3月15日 20:56
复数 题解:
P1021
回复 0
|
赞 0
|
浏览 355
#include<bits/stdc++.h> using namespace std; int main(){ // a+bi c+di double a,b,c,d; char x; cin >> a >> b >> c >> d >> x; if(x == '+') printf...
zxjrheaven
2025年3月13日 20:31
复数 题解:暴力
P1021
回复 0
|
赞 3
|
浏览 342
#include <bits/stdc++.h> using namespace std; struct node { double shi1; double xu1; double shi2; double xu2; char fu; }; int main() { node a;  ...
Candour
2024年4月20日 16:47
复数 题解:
P1021
回复 0
|
赞 3
|
浏览 817
#include<bits/stdc++.h> using namespace std; float a, b, c, d; char ch; int main() { cin >> a >> b >> c >> d >> ch; if(ch == '+') printf("%.1f %.1f", a + c, b + d); else printf("%.1f %.1f", a * c - b * d, a * d + c * b); return...
damowanghwj
2024年3月24日 19:40
复数 题解:c++struct 和 运算符重载实现
P1021
回复 0
|
赞 1
|
浏览 984
#include<bits/stdc++.h> using namespace std; struct Complex{ double real; double image; Complex operator + (const Complex &c) const{ Complex cpx; cpx.real = this->real + c.real; cpx.image = this->image + c.image; return cpx; ...
Cookie‘s AE86
2024年3月21日 10:40
复数 题解:c++实现
P1021
回复 0
|
赞 4
|
浏览 1.0k
#include<bits/stdc++.h> using namespace std; void add(double xa, double xb, double ya, double yb){ double a = xa + ya; double b = xb + yb; printf("%.1f %.1f\n", a, b); } void mutiply(double xa, double xb, double ya, double yb){ double a = xa*ya - xb*yb; do...
光明守护神
2024年3月10日 19:47
复数 题解:纯C++
P1021
回复 0
|
赞 0
|
浏览 687
#include<iomanip> #include <iostream> using namespace std; int main() { float a, ai, b, bi; char c; float r, ri; while (cin >> a >> ai >> b >> bi >> c) { cout.setf(ios::fixed); if (c == '+') { cout << setprecision(1) &...
小王桐学
2024年2月6日 16:51
复数 题解:C
P1021
回复 0
|
赞 5
|
浏览 1.3k
复数的加法运算 (a+bi)+(c+di)=(a+c)+(b+d)i 复数的减法运算 (a+bi)-(c+di)=(a-c)+(b-d)i 复数的乘法运算 (a+bi)(c+di)=(ac-bd)+(bc+ad)i 复数的除法运算 (a+bi)/(c+di) =(ac + bd)/(c^2 + d ^2) +((bc - ad)/(c ^2 + d ^2)) i #include <stdio.h> void Operator(float a1,float b1,float a2,float b2,char op...
Hegel
2023年3月24日 17:32
复数的加法与乘法
P1021
回复 0
|
赞 1
|
浏览 2.3k
#include <iostream> using namespace std; int main() { float a,b,c,d; char x; cin>>a>>b>>c>>d>>x; if(x=='+') printf("%.1f %.1f",a+c,b+d); else printf("%.1f %.1f",a*c-b*d,b*c+a*d); return 0; } 注: ai*bi=-(a*b) 输出时的格式问题,题目要求保留一位小数,...
sincerely_LM
2021年2月20日 16:55
对于输入输出格式的查缺补漏 %lf ,%.1f
P1021
回复 0
|
赞 1
|
浏览 9.7k
#include <stdio.h> #include <stdlib.h> int main(int argc, char const *argv[]) { double n1,n2,x1,x2; char op; scanf("%lf %lf %lf %lf %c",&n1,&x1,&n2,&x2,&op);//查缺补漏:对于double的输入要用%lf switch (op){ case '+' : add(n1,x1,n2,x2);break ; case '*' : mul...
fanxi
2020年5月10日 14:23
输入时不会吃符号,因为有空格来接收最后一个数字后面的空格输入
P1021
回复 0
|
赞 8
|
浏览 9.9k
#include int main() { double a1,b1,a2,b2; char sign; scanf("%lf %lf %lf %lf %c",&a1,&b1,&a2,&b2,&sign); double a,b; if(sign=='+') { a=a1+a...
1
2
题目
复数
题解数量
13
发布题解
在线答疑
热门题解
1
输入时不会吃符号,因为有空格来接收最后一个数字后面的空格输入
2
复数 题解:C
3
复数 题解:c++实现
4
复数 题解:暴力
5
复数 题解:
6
复数的加法与乘法
7
复数(c++)
8
复数(没搞懂为什么用%c就不行)
9
复数 题解:c++struct 和 运算符重载实现
10
这是我第一遍想到的结果,还没想有没有更好的,写完全部有时间再做一遍