Cod sursa(job #1315199)
Utilizator | Data | 12 ianuarie 2015 16:16:35 | |
---|---|---|---|
Problema | Factorial | Scor | 5 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.25 kb |
#include <fstream>
using namespace std;
ifstream in("fact.in");
ofstream out("fact.out");
int main()
{
int f=0,nrz,z=1,p;
in>>p;
nrz=p;
while(nrz>0)
{
nrz=nrz-z;
z++;
f++;
}
out<<f*5;
}