Cod sursa(job #612067)
Utilizator | Data | 5 septembrie 2011 17:40:31 | |
---|---|---|---|
Problema | Factorial | Scor | 5 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.33 kb |
#include <iostream>
#include <fstream>
#include <math.h>
using namespace std;
int main (void) {
long p, n;
int OK=1;
ifstream q("fact.in");
ofstream g("fact.out");
q>>p;
n=p*4;
while (n<500000000 && OK==1) {
if (n/5==p) {
OK=0;
g<<n;}
n++;}
if (OK==1) g<<-1;
q.close ();
g.close ();
return 0;}