90 分,不知道哪里错了
查看原帖
90 分,不知道哪里错了
603997
purplepolarstar楼主2023/8/31 08:43
#include<bits/stdc++.h>
using namespace std;
int abslote(int n){
    if (n>=0) return n;
    else return -n;
}
int main(){
    int a,b,sub=2,count=0;
    cin>>a>>b;
    if (a==0||b==0) cout<<abslote(a+b);
    else {
        if (a==b) cout<<abslote(a);
        else{
            if (abslote(a)<abslote(b)) cout<<abslote(2*a)+abslote(b);
            else cout<<abslote(a)+abslote(2*b);
        }
    }
    return 0;
}
2023/8/31 08:43
加载中...