Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
97675 程余天皓 闰年的数量 C++ Compile Error 0 MS 0 KB 335 2024-11-16 12:11:02

Tests(0/0):


Code:

#include<iostream> using namespace std; bool run(int year){ bool run(int year){ if(year%4==0&&year%100!=0){ return 1; }else if(year%400==0){ return 1; } else{ return 0; } } int main() { int x,y,sum=0; cin>>x>>y; for(int i=x;i<=y;i++){ if(run(i)==1){ sum++; } } return 0; }


Run Info:

Main.cc: In function 'bool run(int)':
Main.cc:4:20: error: a function-definition is not allowed here before '{' token
  bool run(int year){
                    ^
Main.cc:24:1: error: expected '}' at end of input
 }
 ^
Main.cc:24:1: warning: no return statement in function returning non-void [-Wreturn-type]