Generation

translateSun, 07 May 2023

Eleve al cuadrado un número si es par y al cubo si es impar

int main() { int x; cin >> x; if(x%2==0){ cout << x*x << endl; }else{ cout << x*x*x << endl; } }

Questions about programming?Chat with your personal AI assistant