Cod sursa(job #507240)

Utilizator teo93Petrescu Teodor teo93 Data 5 decembrie 2010 17:28:53
Problema Factorial Scor 10
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.31 kb
#include<iostream>
#include<fstream>
using namespace std;
int main()
{

	int nr,p,t,aux;
	ifstream f("fact.in");
	ofstream g("fact.out");
	f>>p;
	t=5*p;
	aux=p-1;
	nr=0;
	while(aux>=0)
		{	aux=aux-5;
				nr++;
		}
	if(nr!=0)
		nr--;
	t=t-5*nr;
	g<<t;
	f.close();
	g.close();
	 
	return 0;
}