Cod sursa(job #635710)

Utilizator andreea29Iorga Andreea andreea29 Data 19 noiembrie 2011 14:24:36
Problema Dirichlet Scor 0
Compilator cpp Status done
Runda .com 2011 Marime 0.29 kb
#include<fstream>
#include<iostream>
using namespace std;
int n, k;
int solve (int k)
{
	if (k==1)
		return 1;
	else
		return (k-1)*solve(k-1)+1;
}
int main()
{
	ifstream f("dirichlet.in");
	ofstream h("dirichlet.out");
	f>>n;
	h<<solve (n);
	
	f.close();
	h.close();
	return 0;
}