【題解】ZeroJudge d250: 94北縣賽-2-數獨問題 (Sudoku)

題目敘述:https://zerojudge.tw/ShowProblem?problemid=d250

#include <iostream>
using namespace std;

int main(){
    int n;
    int temp;
    while (cin >> n){
        temp = 45;
        for (int j = 0; j < 9; j++){
            temp -= n % 10;
            n /= 10;
        }
        cout << temp << "\n";
    }
}
分享本文 Share with friends