Cod sursa(job #2151148)
Utilizator | Data | 4 martie 2018 09:59:25 | |
---|---|---|---|
Problema | Factorial | Scor | 5 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.32 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream fin("fact.in");
ofstream fout("fact.out");
int n,p,ok;
bool fact=1;
int main()
{
fin>>p;
n=p;
for (int i=1;i<=n;i++)
{
fact=fact*i;
}
while (fact%10==0)
{
ok++;
fact=fact/10;
}
fout<<n+1;
}