Cod sursa(job #1116633)
Utilizator | Data | 22 februarie 2014 18:39:28 | |
---|---|---|---|
Problema | Factorial | Scor | 15 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.36 kb |
#include<fstream>
using namespace std;
long long p,n=1,i,k,z;
const short v[]={0,1,1,1,1,2,1,1,1,1,2,1,1,1,1,2,1,1,1,1,2,1,1,1,1,3};
int main()
{
ifstream fin("fact.in");
ofstream fout("fact.out");
fin>>p;
while(k!=p)
{
i++;z++;
n=5*i;
k+=v[z];
if(z==25)z=0;
}
fout<<n;
return 0;
}