Cod sursa(job #1708924)

Utilizator UCV_DUMITRU_ENACHE_MITROIUCV DUMITRU MITROI ENACHE UCV_DUMITRU_ENACHE_MITROI Data 28 mai 2016 10:15:42
Problema Carte2 Scor 100
Compilator cpp Status done
Runda ONIS 2016 - Runda - 2 - ACM ICPC Romanian Programming Contest Marime 0.93 kb
#include <iostream>
#include <stdio.h>
#include <fstream>
#include <algorithm>
using namespace std;

int main()
{
    int a,b;
    int c[3];
    int t;

//    ifstream f("");
    FILE *f = fopen("carte2.in","r");
    FILE *g = fopen("carte2.out","w");
//    f>>t;
//    fscanf(f,"%d%d",&a,&b);

    fscanf(f,"%d",&t);
    for(int i = 0; i < t; i++){
//        t >> a >> b;

    fscanf(f,"%d%d",&a,&b);
        if(a<b){
            swap(a,b);
        }

//        t >> c[0] >> c[1] >> c[2];

    fscanf(f,"%d%d%d",&c[0],&c[1],&c[2]);
        sort(c,c+3);
//cout << c[0] << " " << c[1]  << " " << c[2] << endl;
//cout << a << " " << b << endl;
//        sort(c[0],c[1]);
        if( c[2] > a && c[1] > b){
//            cout << "posibil" << endl;
            fprintf(g,"posibil\n");
        }
        else {
            fprintf(g,"imposibil\n");
//            cout << ""<<endl;
        }
    }

    return 0;

}