Cod sursa(job #1975605)
Utilizator | Data | 1 mai 2017 15:04:58 | |
---|---|---|---|
Problema | Factorial | Scor | 10 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.49 kb |
#include <iostream>
#include <fstream>
#define MAX 1000
using namespace std;
ifstream in("fact.in");
ofstream out("fact.out");
int P;
int main()
{
in>>P;
if(P == 0){
cout<<1;
out<<'1';
return 0 ;
}
for(int i = 0 ; i < MAX; i ++){
int a = i/5;
if(a == P){
if(i % 25 == 0){
out<<i-5;
return 0;
}
out<<i;
return 0;
}
}
}