ZJANS

d277. 矩形对角线

Beginner Last Update: 2026/02/01
數學

給一對角線使用的盆數
求完成另一對角線所需的數量


解法一

✅ 完整代碼

評分結果(參考) : AC (1ms, 312KB)

#include<bits/stdc++.h>
#define int long long
using namespace std;

signed main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    
    int n;
    while(cin >> n){
        cout << ((n&1) ? n-1 : n) << "\n";
    }

    return 0;
}