Cod sursa(job #2023926)

Utilizator teodor440Teodor Tonghioiu teodor440 Data 19 septembrie 2017 18:02:44
Problema Factorial Scor 45
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.32 kb
#include <fstream>

using namespace std;

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

int n, m, v[100];

int main()
{
	int i, j, p, nrz = 0;
	f >> p;
	while (nrz < p) {
		i = 0;
		nrz++;
		v[i]++;
		while (v[i] % 5 == 0) {
			i++;
			v[i]++;
			nrz++;
		}
		n += 5;
	}
	g << n;

	return 0;
}