Cod sursa(job #1626180)
Utilizator | Data | 2 martie 2016 23:12:09 | |
---|---|---|---|
Problema | Factorial | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.33 kb |
#include <fstream>
#include <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";
}