Pagini recente » Cod sursa (job #1833881) | Cod sursa (job #1903494) | Cod sursa (job #3299654) | Cod sursa (job #1836659)
#include <iostream>
#include <fstream>
#include <limits>
#include <tgmath.h>
using namespace std;
int main()
{
int n,p;
long long int fact;
ifstream fisier("fact.in.txt");
while(fisier>>p)
{
}
for( n=0; n<=10; n++)
{
fact = 1;
for(int i=1; i<=n; i++)
{
fact=fact*i;
}
if(p>8)
{
cout<<"nu merge";
break;
}
if(fact%((int)pow(10,p))==0)
{
break;
}
}
ofstream fisier2;
fisier2.open("fact.out.txt");
fisier2<<n;
}