제출 #715106

#제출 시각아이디문제언어결과실행 시간메모리
715106The_Cat_PersonLogičari (COCI21_logicari)C++14
컴파일 에러
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;
}

컴파일 시 표준 에러 (stderr) 메시지

Main.cpp: In function 'int main()':
Main.cpp:8:54: error: expected primary-expression 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*/
      |                                                      ^