SHARE
TWEET

Untitled

a guest Sep 15th, 2019 91 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int numero = 0;
  8.     int kuutio = 0;
  9.     int kuutiojuuri = 0;
  10.     cout << "Enter a number: ";
  11.     cin >> numero;
  12.     kuutio = numero * numero * numero;
  13.     if ( numero == 0 ) {
  14.         cout << "The cube of 0 is 0." << endl;
  15.     } else {
  16.         kuutiojuuri = kuutio / numero / numero;
  17.         if ( kuutiojuuri != numero ) {
  18.             cout << "Error! The cube of " << numero << " is not " << kuutio << "." << endl;
  19.         } else {
  20.             cout << "The cube of " << numero << " is " << kuutio << "." << endl;
  21.         }
  22.     }
  23. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top