Cod sursa(job #674859)
Utilizator | Data | 6 februarie 2012 20:28:17 | |
---|---|---|---|
Problema | Factorial | Scor | 10 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.24 kb |
#include <fstream>
using namespace std;
ifstream f("fact.in");
ofstream g("fact.out");
int p,i,x,y;
int main(){
f>>p;i=0;
while(y<=p){
i=+5;
x=i;
while(x%5==0){
x/=5;
y++;
}
}
if(i==p)
g<<i;
else
g<<-1;
}