Pagini recente » Cod sursa (job #1178192) | Cod sursa (job #2637539) | Cod sursa (job #2787414) | Cod sursa (job #200429) | Cod sursa (job #2473178)
#include <iostream>
#include <fstream>
using namespace std;
ifstream in("fact.in");
ofstream out("fact.out");
int power( int base, int exp);
long long int factorial(int n);
int main() {
long long int p, n, f, op;
in >> p;
if (p > 0) { out << p * 5; }
else if (p == 0) { out << 1; }
else { out << -1; }
/*op = power(10, p);
n = 1;
f = factorial(n);
while (f % op != 0) {
n++;
f = factorial(n);
}
if (n >= 1) { cout << n; }
else cout << -1;*/
return 0;
}
int power(int base, int exp) {
int result = 1;
for (int c = 1;c <=exp;c++) {
result = result * base;
}
return result;
}
long long int factorial(int n) {
if (n > 0) { return(n * factorial(n - 1)); }
else return 1;
}