文章

44

粉丝

18

获赞

334

访问

25.6k

头像
复数相加 题解:
P1438 北京理工大学机试题
发布于2025年3月19日 23:29
阅读数 31

#include<iostream>
#include<string>
#include<iomanip>
using namespace std;
class fushu{
    public:
        double a,b;
        fushu(double x,double y):a(x),b(y){}
        fushu operator+(fushu &A)const{
            fushu t(a+A.a,b+A.b);
            return t;
        }
};
int main(){
    int m;
    cin>>m;
    while(m--){
        double a,b,c,d;
        cin>>a>>b>>c>>d;
        fushu A(a,b),B(c,d);
        fushu t=A+B;
        if(t.b>0)
            c...

登录查看完整内容


登录后发布评论

暂无评论,来抢沙发