Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
66968 伍思语 判断闰年I C++ Compile Error 0 MS 0 KB 220 2024-03-12 19:10:51

Tests(0/0):


Code:

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


Run Info:

Main.cc: In function 'int main()':
Main.cc:6:5: error: redeclaration of 'int year'
 int year;
     ^
Main.cc:4:5: note: 'int year' previously declared here
 int year;
     ^
Main.cc:8:30: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
 if (year%400==0 || year%4==0 && year%100!=0){
                              ^
Main.cc:10:8: error: expected '(' before '{' token
 else if{
        ^