Cod sursa(job #1186700)
Utilizator | Data | 17 mai 2014 14:35:24 | |
---|---|---|---|
Problema | Factorial | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.36 kb |
#include <iostream>
#include <fstream>
using namespace std;
ifstream f("factorial.in");
ofstream g("factorial.out");
bool verif( int x ) {
while(x){
if(x%5) return 1;
x/=5;
}
return 0;
}
int main()
{
long a;
f>>a;
if( a==0 ) { g<<1; return 0; }
if (verif(a)) { g<<-1; return 0; }
return 0;
}