Pagini recente » Cod sursa (job #1478326) | Cod sursa (job #217350) | Cod sursa (job #2324884) | Cod sursa (job #646660) | Cod sursa (job #2980900)
#include <bits/stdc++.h>
using namespace std;
ifstream f("patrate2.in");
ofstream g("patrate2.out");
int h[100000];
void produs(int *h, int x) {
int i, T = 0;
for (i = 1; i <= h[0]; i++) {
h[i] = h[i] * x + T;
T = h[i] / 10;
h[i] = h[i] % 10;
}
while (T) {
h[++h[0]] = T % 10;
T /= 10;
}
}
int main(){
int n;
f >> n;
h[0] = h[1] = 1;
for(int i = 2; i <= n; ++i) produs(h, i);
for(int i = 1; i <= n * n; ++i) produs(h, 2);
for(int i = h[0];i >= 1; --i) g << h[i];
f.close();
g.close();
return 0;
}