답안 #1089919

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1089919 2024-09-17T11:52:31 Z solitaryMan Room Temperature (JOI24_ho_t1) C++17
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>

using namespace std;
#define endl "\n"
#define ll long long
#define line cout << "---------------------------" << endl;
#define M -1
#define debug(x) cout << "x " << x << endl;
#define all(a) a.begin(), a.end()
#define INF (int) 1e9


bool int_(float n){
	return float(n) == ceil(n); 
}

int gcd(int a, int b){
	return __gcd(a,b);
}

bool prime(int n){
	for(int i = 2; i <= sqrt(n); i++){
		if(n % i == 0) return false;
	}
	return true;
}


string showbit(int n){
	string s = "";
	for(int i = 31; i >= 0 ; i--){
		if(n & (1 << i)) s += "1"
		else s += "0" ;
	}
	return s;
}

bool sq(int n){
	return n * n;
}
void solve(){
	cout << 0 << endl;
}
int32_t main(){
	int t = 1;
	//cin >> t;
	while(t--){solve();}
	    cerr << "Execution time: " << 1000.f * clock() / CLOCKS_PER_SEC << " ms." << endl;

}

Compilation message

Main.cpp: In function 'std::string showbit(int)':
Main.cpp:33:28: error: expected ';' before 'else'
   33 |   if(n & (1 << i)) s += "1"
      |                            ^
      |                            ;
   34 |   else s += "0" ;
      |   ~~~~                      
Main.cpp: In function 'bool sq(int)':
Main.cpp:40:11: warning: '*' in boolean context, suggest '&&' instead [-Wint-in-bool-context]
   40 |  return n * n;
      |         ~~^~~