Cod sursa(job #1320591)

Utilizator ALEx6430Alecs Andru ALEx6430 Data 18 ianuarie 2015 09:51:51
Problema Energii Scor 5
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.34 kb
#include <iostream>
#include <fstream>

using namespace std;

ifstream in("energii.in");
ofstream out("energii.out");

int main()
{
    int g,w,eg,cg,x=-1;
    in>>g>>w;
    for(int i=1;i<=g;i++)
    {
        in>>eg>>cg;
        if(eg>=w)
            x=cg;
    }
    out<<x;
    in.close();
    out.close();
    return 0;
}