Pagini recente » Cod sursa (job #1993000) | Rating UBB Boboc Petrutiu Tamas (UBB_NAMBAR_UAN) | Cod sursa (job #2627351) | Diferente pentru problema/luffxor intre reviziile 1 si 4 | Cod sursa (job #2970006)
#include <iostream>
#include <fstream>
using namespace std;
int main() {
ifstream in("fact.in");
ofstream out("fact.out");
int i = 0;
int p, ct = 0;
in >> p;
if(p < 0 ){
out << -1;
return 0;
}
if(p == 0) {
out << 1;
return 0;
}
while(p + 1 != ct) {
if(i % 10 == 5)
ct++;
if(i % 10 == 0)
ct++;
i += 5;
}
out << i - 5;
}