Cod sursa(job #612058)
Utilizator | Data | 5 septembrie 2011 17:18:38 | |
---|---|---|---|
Problema | Factorial | Scor | 10 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.31 kb |
#include <iostream>
#include <fstream>
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+1;
while (n<500000000 && OK==1) {
if (n%5==0) {
g<<n;
OK=0;}
n++;}
if (OK==1) g<<-1;
q.close ();
g.close ();
return 0;}