Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
5898 谢锦卓 13投资金额II C++ Compile Error 0 MS 0 KB 324 2024-12-21 09:15:01

Tests(0/0):


Code:

#include<iostream> // cin\cout\endl using namespace std; int main(){ int n,z; cin>>n>>z; for(int i=1;i<=y;i++){ if(i%100==0&&i%400==0||i%100!=0&&i%4==0){ z=z*1.3; } else z=z*1.2; //cout<<i<<":"<<n<<endl; } cout<<z<<endl; return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:6:20: error: 'y' was not declared in this scope
     for(int i=1;i<=y;i++){
                    ^
Main.cc:7:20: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
         if(i%100==0&&i%400==0||i%100!=0&&i%4==0){
                    ^