Cod sursa(job #1919279)
Utilizator | Data | 9 martie 2017 18:34:46 | |
---|---|---|---|
Problema | Factorial | Scor | 5 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.39 kb |
#include <fstream>
#include <math.h>
#include <algorithm>
using namespace std;
ifstream cin("fact.in");
ofstream cout("fact.out");
int main()
{
int p,n=0;
cin>>p;
if(p==0)
cout<<1;
else
{
while(p)
{
n=n+5;
p--;
}
if(n%10==0)
cout<<n;
else
cout<<n-5;
}
}