Cod sursa(job #2058566)

Utilizator Consti.001FMI Dranca Constantin Consti.001 Data 5 noiembrie 2017 20:13:15
Problema A+B Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.5 kb
#include<fstream>
#include<algorithm>

using namespace std;

ifstream f("data.in");
ofstream g("data.out");

struct punct
{
    double x,y,panta;

} v[4],first, aux ;

int maint()
{
    short poz=0;
    first.x=first.y=99999999;
    for(int i=0;i<4;++i)
    {
        f>>v[i].x>>v[i].y;
        if(first.x>v[i].x||(first.x==v[i].x&&first.y<v[i].y))
        {
            first=v[i];
            poz=i;
        }
    }
    aux=v[0];
    v[0]=v[poz];
    v[poz]=aux;
    return 0;
}