Cod sursa(job #130095)

Utilizator zalmanDanci Emanuel Sebastian zalman Data 31 ianuarie 2008 11:23:54
Problema GFact Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.35 kb
#include<fstream.h>
long a,b,aux,n,j;
ifstream f("gfact.in");
ofstream g("gfact.out");
int main()
{
f>>a>>b;

aux=1;
for(int i=1;i<=b;i++)
aux*=a;


	  int max=0;

	  for(i=2;i<=aux/2;i++)
	  if(aux%i==0)
	   max=i;

	  aux=1;
	  for(j=1;j<=max;j++)
	  aux=aux*j;

	  g<<max;

	  f.close();
	  g.close();
	  return 0;





}