Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
165103 屠思宇 09优惠活动 C++ Compile Error 0 MS 0 KB 365 2026-11-09 20:27:52

Tests(0/0):


Code:

#include<bits/stdc++.h> using namespace std; int main(){ char P,G,S,C; double money; cin>>c>>money; if (c=='P'){ money*0.7; } else if (c=='G'){ money*0.8; } else if (c=='S'){ money*0.9; } else{ money*9.5; } cout<<fixed<<setprecision(2)<<money<<endl; return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:6:10: error: 'c' was not declared in this scope
     cin>>c>>money;
          ^
Main.cc:8:14: warning: statement has no effect [-Wunused-value]
         money*0.7;
              ^
Main.cc:11:14: warning: statement has no effect [-Wunused-value]
         money*0.8;
              ^
Main.cc:14:14: warning: statement has no effect [-Wunused-value]
         money*0.9;
              ^
Main.cc:17:14: warning: statement has no effect [-Wunused-value]
         money*9.5;
              ^
Main.cc:4:10: warning: unused variable 'P' [-Wunused-variable]
     char P,G,S,C;
          ^
Main.cc:4:12: warning: unused variable 'G' [-Wunused-variable]
     char P,G,S,C;
            ^
Main.cc:4:14: warning: unused variable 'S' [-Wunused-variable]
     char P,G,S,C;
              ^
Main.cc:4:16: warning: unused variable 'C' [-Wunused-variable]
     char P,G,S,C;
                ^