Cod sursa(job #1451227)

Utilizator nixman97Pogacean VIctor Paul nixman97 Data 16 iunie 2015 16:35:44
Problema Factorial Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.33 kb
#include <iostream>
#include<math.h>
#include<stdlib.h>
#include<fstream>

using namespace std;
ifstream in("fact.in");
ofstream out("fact.out");
int main()
{
	int P,n=1,i=0,count=0,x=5,cc=1;
	cin>>P;
	while (1)
	{
		if (x==i)
		{
			cc++;
			x=x*x;
			count=count+cc-2;
		}
		i=i+5;
		count++;
		if (count==P) break;
	}
	cout<<i;
}