Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
98818 | 华雅萱 | 08有几个闰年 | C++ | Compile Error | 0 MS | 0 KB | 332 | 2024-11-23 15:06:09 |
#include<iostream> using namespace std; int main(){ int y1,y2,y3,sum=0; cin>>y1>>y2>>y3; if(y1%4==0 && y1%100!=0 || y1%400=0){ sum++; } if(y2%4==0 && y2%100!=0 || y2%400=0){ sum++; } if(y3%4==0 && y3%100!=0 || y3%400=0){ sum++; } cout<<sum; return 0; }
Main.cc: In function 'int main()': Main.cc:6:16: warning: suggest parentheses around '&&' within '||' [-Wparentheses] if(y1%4==0 && y1%100!=0 || y1%400=0){ ^ Main.cc:6:38: error: lvalue required as left operand of assignment if(y1%4==0 && y1%100!=0 || y1%400=0){ ^ Main.cc:9:16: warning: suggest parentheses around '&&' within '||' [-Wparentheses] if(y2%4==0 && y2%100!=0 || y2%400=0){ ^ Main.cc:9:38: error: lvalue required as left operand of assignment if(y2%4==0 && y2%100!=0 || y2%400=0){ ^ Main.cc:12:16: warning: suggest parentheses around '&&' within '||' [-Wparentheses] if(y3%4==0 && y3%100!=0 || y3%400=0){ ^ Main.cc:12:38: error: lvalue required as left operand of assignment if(y3%4==0 && y3%100!=0 || y3%400=0){ ^