#include <iostream>
using namespace std;
int main(){
int x, n, z=1;
int sum=0;
cout << "Podaj x: ";
cin >> x;
cout << "Podaj n: ";
cin >> n;
for (int i=0;i<n; i++){
sum=0;
for (int j=0;j<z;j++)
sum+=x;
z = sum;
}
cout << "Wynik potegowania to: " << sum;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgoKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmludCBtYWluKCl7CiAgICBpbnQgeCwgbiwgej0xOwogICAgaW50IHN1bT0wOwoKICAgIGNvdXQgPDwgIlBvZGFqIHg6ICI7CiAgICBjaW4gPj4geDsKICAgIGNvdXQgPDwgIlBvZGFqIG46ICI7CiAgICBjaW4gPj4gbjsKCiAgIGZvciAoaW50IGk9MDtpPG47IGkrKyl7CiAgICBzdW09MDsKICAgIGZvciAoaW50IGo9MDtqPHo7aisrKQogICAgIHN1bSs9eDsKICAgIHogPSBzdW07CiAgIH0KCiAgICBjb3V0IDw8ICJXeW5payBwb3RlZ293YW5pYSB0bzogIiA8PCBzdW07CiAgICByZXR1cm4gMDsKfQ==