Cod sursa(job #1666837)

Utilizator mateescudragosMateescu Dragos mateescudragos Data 28 martie 2016 13:47:09
Problema Factorial Scor 10
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.82 kb
// test1.cpp : Defines the entry point for the console application.
//

//#include "stdafx.h"
#include "stdio.h"
#include "fstream"
#include "iostream"
#include "string"

using namespace std;

void citire(int* x)
{
	ifstream myfile;
	myfile.open("fact.in");
	myfile >> *x;
	myfile.close();
}

void scriere(int x)
{
	ofstream outfile;
	outfile.open("fact.out");
	outfile << x;
	outfile.close();
}



int main()
{
	int p;
	int m2=0, m5=0, m10=0,i=1;

	citire(&p);
//	while(m10<p)
//	{
	//	i++;
	//  if (i%2==-0) {
//			m2++;
//		}
//		if ((i%5)==0) {
//			m5++;
//		}
//		if ((m2>=1)&&(m5>=1)){
//			m10++;
//			m2=0;
//			m5=0;
//		};

//	};
	if (p==0) scriere(i=1);
	else if (p==2) scriere(i=10);
	else scriere(i=(p-(p/6))*5);
//	else scriere(i=p*5);
	
//	scriere(i);
	return 0;
}