Cod sursa(job #1573687)
Utilizator | Data | 19 ianuarie 2016 21:02:03 | |
---|---|---|---|
Problema | Iepuri | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.49 kb |
#include <iostream>
using namespace std;
int main()
{
int t , x , y , z , a , b , c , n , m ;
cout<<"Dati numarul de seturi: T=";
cin>>t;
while(t>=1)
{
cout<<"x: "<<"y: "<<"z: "<<"a: "<<"b: "<<"c: "<<"n: ";
cin>>x;
cin>>y;
cin>>z;
cin>>a;
cin>>b;
cin>>c;
cin>>n;
while(n>=3)
{
m=z*a+y*b+x*c;
n--;
x=y;
y=z;
z=m;
}
t=t-1;
cout<<m<<endl;
}
}