Cod sursa(job #2092255)
Utilizator | Data | 21 decembrie 2017 14:28:28 | |
---|---|---|---|
Problema | Factorial | Scor | 10 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.38 kb |
#include <iostream>
#include <algorithm>
#include <cmath>
#include <fstream>
using namespace std;
ifstream in("fact.in");
ofstream out("fact.out");
int main(){
int p;
long long x=0;
in>>p;
if(p==0){
out<<1;
return 0;
}
while(p>0){
x+=5;
if(x%25==0)
--p;
--p;
}
out<<x;
return 0;
}