Cod sursa(job #275347)

Utilizator mathboyDragos-Alin Rotaru mathboy Data 10 martie 2009 13:26:36
Problema Koba Scor 20
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.25 kb
#include <fstream.h>
ifstream f("koba.in");
ofstream g("koba.out");
int main()
{
long long n,i,s,x,y,z,t;
f>>n>>x>>y>>z;
s=x%10+y%10+z%10;
for(i=4;i<=n;i++)
	{ t=(z%10+y%10*x%10);
	s+=t%10;x=y%10;y=z%10;z=t%10;
	}
	g<<s;
	return 0;
        }