Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int numero = 0;
- int kuutio = 0;
- int kuutiojuuri = 0;
- cout << "Enter a number: ";
- cin >> numero;
- kuutio = numero * numero * numero;
- if ( numero == 0 ) {
- cout << "The cube of 0 is 0." << endl;
- } else {
- kuutiojuuri = kuutio / numero / numero;
- if ( kuutiojuuri != numero ) {
- cout << "Error! The cube of " << numero << " is not " << kuutio << "." << endl;
- } else {
- cout << "The cube of " << numero << " is " << kuutio << "." << endl;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement