C++
#include <iostream>
#include<cmath>
using namespace std;
int main() {
setlocale(LC_ALL, "RUS");
int a;
cout << "Введите числа a: ";
cin >> a;
if (a > 0)
{
a = a * a;
}
else
a = a * a * a;
cout << "a = " << a << endl;
return 0;
A=int(input())
if A>0:
print(A**2)
else:
print(A**3)
C++
#include <iostream>
#include<cmath>
using namespace std;
int main() {
setlocale(LC_ALL, "RUS");
int a;
cout << "Введите числа a: ";
cin >> a;
if (a > 0)
{
a = a * a;
}
else
{
a = a * a * a;
}
cout << "a = " << a << endl;
return 0;
}
A=int(input())
if A>0:
print(A**2)
else:
print(A**3)