2016年11月10日 星期四

TIOJ 1185 - 三角蕃的煩惱

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

三角形基本性質
用int小心會噴掉



 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
#include<bits/stdc++.h>
using namespace std;
unsigned int a[3];
int main(){
    while(cin>>a[0]>>a[1]>>a[2]){
        sort(a,a+3);
        if(a[0]+a[1]>a[2]){
            cout<<"SAFE\n";
        }
        else{
            cout<<"BYE\n";
        }
    }
}

沒有留言:

張貼留言