Advertisement
35657

Untitled

Mar 23rd, 2024
514
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.33 KB | None | 0 0
  1.  
  2. #include <iostream>
  3.  
  4. using namespace std;
  5.  
  6.  
  7. void degree(double n) {
  8.     if (n == 1) {
  9.         cout << "YES" << endl;
  10.     }
  11.     else if (n < 2) {
  12.         cout << "NO" << endl;
  13.     }
  14.     else {
  15.         return degree(n / 2);
  16.     }
  17. }
  18.  
  19.  
  20. int main() {
  21.     setlocale(LC_ALL, "ru");
  22.  
  23.     degree(32);
  24.  
  25.     degree(35);
  26.    
  27. }
  28.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement