Cod sursa(job #681233)
Utilizator | Data | 16 februarie 2012 19:44:22 | |
---|---|---|---|
Problema | Energii | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.41 kb |
#include <iostream>
#include <fstream>
using namespace std;
ifstream f;
ofstream m;
long G,W,i,a[6];
int main()
{
f.open("energii.in");
m.open("energii.out");
f>>G;
f>>W;
if((1<G<1001)and(1<W<5001))
{
for(i=1;i<=6;i++)
{
f>>a[i];
}
for(i=1;i<=6;i++)
{
if((a[i]==W)&&(1<a[i]<10001)&&(1<a[i+1]<10001))
{
m<<a[i+1];
}
}
}
return 0;
}