Pagini recente » Monitorul de evaluare | Cod sursa (job #382597) | Cod sursa (job #291882) | Cod sursa (job #1753402) | Cod sursa (job #1709134)
// ConsoleApplication1.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <fstream>
using namespace std;
ifstream f("carte2.in");
ofstream g("carte2.out");
int pos(int A, int B, int C, int D, int E)
{
if (A < D && B < E) return 1;
if (A < E && B < D) return 1;
if (A < C && B < D) return 1;
if (A < D && B < C) return 1;
if (A < C && B < E) return 1;
if (A < E && B < C) return 1;
return 0;
}
int main()
{
int T, A, B, C, D, E, i;
f>> T;
for (i = 1;i <= T;i++)
{
f >> A >> B >> C >> D >> E;
if (pos(A, B, C, D, E) == 1) g << "posibil\n";
else g << "imposibil\n";
}
return 0;
}