Submission #715108

#TimeUsernameProblemLanguageResultExecution timeMemory
715108The_Cat_PersonLogičari (COCI21_logicari)C++14
Compilation error
0 ms0 KiB
#include <iostream> using namespace std; int n; int main() { if (((((((((((((((((n%2)%2)%2)%2)%2)%2)%2)%2)%2)%2)%2)%2)%2)%2)%2)%2==1)/*not power of two*/ { cout<<"-1"<<endl; } else /*power of 2*/ { cout<<n/2<<endl; } return 0; }

Compilation message (stderr)

Main.cpp: In function 'int main()':
Main.cpp:8:6: warning: init-statement in selection statements only available with '-std=c++17' or '-std=gnu++17'
    8 |  if (((((((((((((((((n%2)%2)%2)%2)%2)%2)%2)%2)%2)%2)%2)%2)%2)%2)%2)%2==1)/*not power of two*/
      |      ^
Main.cpp:8:74: error: expected ';' before '{' token
    8 |  if (((((((((((((((((n%2)%2)%2)%2)%2)%2)%2)%2)%2)%2)%2)%2)%2)%2)%2)%2==1)/*not power of two*/
      |                                                                          ^
      |                                                                          ;
    9 |     {
      |     ~                                                                     
Main.cpp:12:4: error: expected primary-expression before 'else'
   12 |    else /*power of 2*/
      |    ^~~~
Main.cpp:11:6: error: expected ')' before 'else'
   11 |     }
      |      ^
      |      )
   12 |    else /*power of 2*/
      |    ~~~~
Main.cpp:8:5: note: to match this '('
    8 |  if (((((((((((((((((n%2)%2)%2)%2)%2)%2)%2)%2)%2)%2)%2)%2)%2)%2)%2)%2==1)/*not power of two*/
      |     ^