Cod sursa(job #2171126)
Utilizator | Data | 15 martie 2018 11:18:34 | |
---|---|---|---|
Problema | Koba | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.38 kb |
#include <fstream>
using namespace std;
ifstream fin("koba.in");
ofstream fout("koba.out");
int uc,scif,x,y,z,n,i,tnou;
int main()
{
fin>>n>>x>>y>>z;
for(i=1;i<=n;i++)
{
x=x%10;
y=y%10;
z=z%10;
tnou=z+y*x;
x=y;
y=z;
z=tnou;
scif=scif+tnou%10;
}
fout<<scif;
return 0;
}