Cod sursa(job #1492232)

Utilizator LeVladzCiuperceanu Vlad LeVladz Data 27 septembrie 2015 13:45:12
Problema Koba Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.34 kb
#include <fstream>
using namespace std;
ifstream fin("koba.in");
ofstream fout("koba.out");
long long n,t1,t2,t3,x,y,z,t,s,i;
int main()
{
    fin>>n>>t1>>t2>>t3;
    x=t1%10;y=t2%10;z=t3%10;s=0;
    for(i=1;i<=n;i++)
    {
        t=(z+y*x)%10;
        s=s+t%10;
        x=y%10;y=z%10;z=t%10;
    }
    fout<<s;
    return 0;
}