Cod sursa(job #1329940)

Utilizator codrut_grosuGrosu Codrut-Cristian codrut_grosu Data 30 ianuarie 2015 01:12:06
Problema Factorial Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.54 kb
# include <iostream>
# include <fstream>


int main () {

	std :: ifstream f ("fact.in");
	std :: ofstream g ("fact.out");

	int P;
	int nr = 0;
	int i;
	int a;

	f >> P;	
/*
	if ( P == 0 ) {
		g << 1;
	} else {
		a = P;


		while ( a % 5 != 0 ) {
			a --;
		}

        while ( a != 0 ) {
            i = a;
 
            while ( i % 5 == 0) {
				i /= 5;
				nr ++;
			}
            a -= 5;
        }

		g << ( P - nr ) * 5;

			g << -1;

    }
 */

	if ( ( P + 1 ) % 6 == 0 ) {
		g << -1;
	} else while (true);


    g << '\n';
 
    return 0;
}