Pagini recente » Cod sursa (job #420054) | Cod sursa (job #3167785) | Cod sursa (job #1093247) | Cod sursa (job #1171755) | Cod sursa (job #2490520)
#include <iostream>
#include <fstream>
#include <cmath>
using namespace std;
ifstream fin ("patrate2.in");
ofstream fout ("patrate2.out");
const int MAXN=1000004;
struct Huge
{
int data[MAXN];
};
void mult_with_scalar(Huge &x, int y)
{
int t = 0;
for (int i = 1; i <= x.data[0]; i++)
{
x.data[i] = x.data[i] * y + t;
t = x.data[i] / 10;
x.data[i] %= 10;
}
while (t) {
x.data[++x.data[0]] = t % 10;
t /= 10;
}
}
void print(const Huge &h)
{
for (int i = h.data[0]; i >= 1; i--)
fout << h.data[i];
}
Huge pos;
int main()
{
int n;
fin>>n;
pos.data[0]=1;
pos.data[1]=1;
for(int i=1; i<=n; i++)
{
mult_with_scalar(pos, i);
}
for(int i=1; i<=n*n; i++)
{
mult_with_scalar(pos, 2);
}
print(pos);
return 0;
}