Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
158750 陈襗葳 过生日 C++ Compile Error 0 MS 0 KB 558 2026-08-22 17:02:43

Tests(0/0):


Code:

#include <iostream> using namespace std; bool is_leap(int y) { if((y%4==0 && y%100!=0) || y%400==0){ return true; return false; } int main() { int T; cin >> T; while(T--) { int Y,N; Cin >> Y >> N; int cnt = 0; int ans; for(int i=Y; ;i++){ if(is_leap(i)) { cnt++; if(cnt == N) { ans = i; break; } } } cout << ans << endl; } }


Run Info:

Main.cc: In function 'bool is_leap(int)':
Main.cc:8:12: error: a function-definition is not allowed here before '{' token
 int main() {
            ^
Main.cc:27:1: error: expected '}' at end of input
 }
 ^
Main.cc:27:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^