【題解】ZeroJudge a012: 10055 – Hashmat the Brave Warrior

【題目敘述】https://zerojudge.tw/ShowProblem?problemid=a012

  • 士兵數不會超過263:要宣告long long int。
#include <iostream>
using namespace std;

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    long long n1, n2;
    while (cin >> n1 >> n2){
        cout << abs(n1 - n2) << "\n";
    }
    return 0;
}
分享本文 Share with friends