Pagini recente » Cod sursa (job #2612951) | Cod sursa (job #656097) | Cod sursa (job #2901309) | Cod sursa (job #2789588) | Cod sursa (job #2764680)
#include <fstream>
#include <algorithm>
#include <math.h>
#include <string.h>
using namespace std;
ifstream fin("patrate2.in");
ofstream fout("patrate2.out");
class HugeN {
private:
int x[10005];
public:
HugeN() {
memset((*this).x, 0, sizeof(*this));
(*this).x[0] = 1;
}
HugeN(int n) {
memset((*this).x, 0, sizeof(*this));
do {
(*this).x[++(*this).x[0]] = n % 10;
n = n / 10;
} while (n != 0);
}
HugeN operator * (int n) {
HugeN c;
int i;
c.x[0] = (*this).x[0];
for(i = 1; i <= (*this).x[0]; ++i)
{
c.x[i] = (*this).x[i] * n;
}
for(i = 1; i <= (*this).x[0]; ++i)
{
c.x[i + 1] += c.x[i]/10;
c.x[i] = c.x[i]%10;
}
while (c.x[c.x[0] + 1] != 0)
{
++c.x[0];
c.x[c.x[0] + 1] += c.x[c.x[0]] / 10;
c.x[c.x[0]] %= 10;
}
return c;
}
void print() {
for (int i = (*this).x[0]; i > 0; --i) {
fout << (*this).x[i];
}
fout << endl;
}
};
int main()
{
int N, i;
HugeN rez(1);
fin >> N;
for(i=1; i<=N;i++)
rez = rez * i;
for(i=1; i<=N*N; i++)
rez = rez * 2;
rez.print();
return 0;
}