Pagini recente » Cod sursa (job #518685) | Cod sursa (job #212993) | Cod sursa (job #651397) | Cod sursa (job #2840203) | Cod sursa (job #2328790)
#include <iostream>
#include <fstream>
#include <cmath>
using namespace std;
ifstream f ("patrate2.in");
ofstream g ("patrate2.out");
int x[100000], k, n, t, i;
int main()
{
f >> n;
x[0] = 1;
x[1] = 1;
for(k = 1; k <= n; k++)
{
t = 0;
for(i = 1; i <= x[0]; i++)
{
x[i] = x[i] * k + t;
t = x[i] / 10;
x[i] = x[i] % 10;
}
while(t)
{
x[++x[0]] = t % 10;
t /= 10;
}
}
for(k = 1; k <= n * n; k++)
{
t = 0;
for(i = 1; i <= x[0]; i++)
{
x[i] = x[i] * 2 + t;
t = x[i] / 10;
x[i] = x[i] % 10;
}
while(t)
{
x[++x[0]] = t % 10;
t /= 10;
}
}
for(i = x[0]; i >= 1; i--)
g << x[i];
return 0;
}