2016年11月5日 星期六

TIOJ 1165 - [入門] 好數對

http://tioj.infor.org/problems/1165

就...那樣(?

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
#include<bits/stdc++.h>
using namespace std;

int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int a[3];
    while(cin>>a[0]>>a[1]>>a[2]){
        sort(a,a+3);
        if(a[0]+a[1]==a[2]){
            cout<<"Good Pair\n";
        }
        else cout<<"Not Good Pair\n";
    }
}

沒有留言:

張貼留言