Cod sursa(job #2892542)
Utilizator | Data | 22 aprilie 2022 16:02:22 | |
---|---|---|---|
Problema | Factorial | Scor | 15 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.33 kb |
#include <fstream>
using namespace std;
int main() {
ifstream fin("fact.in");
ofstream fout("fact.out");
int n=0, p;
fin >> p;
if (!p)
n = 1;
else
for (int i = 1; i <= p; ++i) {
n += 5;
if (i%5==0)
++i;
}
fout << n;
return 0;
}