Cod sursa(job #1626174)
Utilizator | Data | 2 martie 2016 23:09:41 | |
---|---|---|---|
Problema | Factorial | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.33 kb |
#include <fstream>
#incluce <math.h>
using namespace std;
ifstream("sume.in")
ofstream("sume.out")
int n, p, c, j,
int main()
__sc(){ while(n>0){n=n/10; c++}}
{
f>>p;
while(__sc(n)<p)
{
n=n*(n+1);
j++;
}
if(j%sqrt(j)==0)
g<<j;
else g<<"-1";
}