aboutsummaryrefslogtreecommitdiff
path: root/challenge-254/ulrich-rieke/cpp/ch-1.cpp
blob: d9cbd687370fed6bd5922339b6c602efc6295036 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <iostream>
#include <cmath>

int main( ) {
   std::cout << "Please enter an integer!\n" ;
   int number ;
   std::cin >> number ;
   double third = 1.0 / 3.0 ;
   double cuberoot = std::pow( static_cast<double>(number ) , third ) ;
   if ( cuberoot == floor( cuberoot ) ) 
      std::cout <<  "true\n" ;
   else 
      std::cout <<  "false\n" ;
   return 0 ;
}