Pagini recente » Cod sursa (job #2700414) | Cod sursa (job #865083) | Cod sursa (job #1043380) | Cod sursa (job #2867005) | Cod sursa (job #1823869)
#include <iostream>
#include <fstream>
using namespace std;
int v[35000];
int v2[35000];
void init(int a, int v[])
{
int cifre = 1, ca = a;
for (; ca; cifre++, ca/=10)
v[0] = cifre;
ca = a;
for (int i = 1; i <= v[0]; i++, a/=10)
v[i] = a%10;
a = ca;
}
void imnu(int v[], int a)
{
int t;
t = 0;
for (int i = 1; i <= v[0]; i++, t/=10)
{
t+=v[i]*a;
v[i] = t%10;
}
for (; t; t/=10)
{
v[0]++;
v[v[0]] = t%10;
}
}
int main ()
{ ifstream read("tamplar.in");
ofstream write("tamplar.out");
int a=1, p,pi;
cin>> p;
init (a, v);
init (a,v2);
for (int x = 1 ;x <= p*p; x++){
imnu(v2, 2);
}
for(int x=1;x<=p;x++)
imnu(v2,x);
for (int i = v2[0]; i > 0; i--)
cout << v2[i];
return 0;
}