Cod sursa(job #602381)
Utilizator | Data | 11 iulie 2011 11:33:05 | |
---|---|---|---|
Problema | Factorial | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.3 kb |
#include <fstream>
using namespace std;
ofstream ofis("fact.out");
ifstream ifis("fact.in");
int main()
{
int i,p;
ifis>>p;
int p1=p;
while (p1%5==0 && p1/5>=5)
p1=p1/5;
if (p1==5)
{
ofis<<-1;
return 0;
}
return 0;
}