Cod sursa(job #474050)
Utilizator | Data | 2 august 2010 10:28:06 | |
---|---|---|---|
Problema | Iepuri | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.37 kb |
#include <iostream>
#include <fstream>
using namespace std;
ofstream g("iepuri.out");
int x[10000000],a,b,c,n,t,i,j,s;
int main ()
{
ifstream f("iepuri.in");
f>>t;
for(i=1;i<=t;i++)
{
f>>x[0]>>x[1]>>x[2];
f>>a>>b>>c;
f>>n;
for(j=3;j<=n;j++)
{ x[j]=x[j-1]*a+x[j-2]*b+x[j-3]*c;
}
g<<x[j-1]<<endl;
}
f.close();
g.close();
return 0;
}