Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
145583 张晓冉 判断闰年I C++ Compile Error 0 MS 0 KB 277 2026-01-25 16:41:59

Tests(0/0):


Code:

#include<cstdio> using namespace std; int main() { int year; cin>>year; if(year > 2500 || year < 2000) return 1; if(year % 4 == 0 && year % 100 != 0 || year % 400 == 0){ cout<<"leap year"; }else{ cout<<"not leap year"; } return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:5:5: error: 'cin' was not declared in this scope
     cin>>year;
     ^
Main.cc:7:22: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
     if(year % 4 == 0 && year % 100 != 0  || year % 400 == 0){
                      ^
Main.cc:8:6: error: 'cout' was not declared in this scope
      cout<<"leap year";
      ^
Main.cc:10:6: error: 'cout' was not declared in this scope
      cout<<"not leap year";
      ^