Cod sursa(job #1889490)
Utilizator | Data | 22 februarie 2017 19:00:10 | |
---|---|---|---|
Problema | Factorial | Scor | 5 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.35 kb |
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
int p, n=1, x=0, ok=0;
ifstream f("fact.in");
ofstream g("fact.out");
f>>p;
if(p==0)
{
g<<"1";
}
else
{
do {
x=x+5;
n=x;
ok++;
}while(ok<p);
}
f.close();
g<<n<<'\n';
g.close();
}