POJ_3913

2019-10-18

http://poj.org/problem?id=3913

简单的排序

//3913
#include<stdio.h>
bool Order(int a,int b,int c){
    if((a<=b&&b<=c)||(a>=b&&b>=c)){
        return true;
    }
    return false;
}
int main(){
    int N,a[30],b[30],c[30];
    int i,j,k;
    bool result[30];
    i = 0;
    scanf("%d",&N);
    while(i<N){
        scanf("%d %d %d",&a[i],&b[i],&c[i]);
        result[i] = Order(a[i],b[i],c[i]);
        i++;
    }
    printf("Gnomes:\n");
    for(i=0;i<N;i++){
        if(result[i]){
            printf("Ordered\n");
        }
        else{
            printf("Unordered\n");
        }
    }
    return 0;
}