Wrong Answer

foo.cc: In function 'int main()':
foo.cc:7:17: warning: format '%f' expects argument of type 'float*', but argument 2 has type 'double*' [-Wformat=]
    7 |         scanf("%f,%f,%s",&a,&b,&op);
      |                ~^        ~~
      |                 |        |
      |                 float*   double*
      |                %lf
foo.cc:7:20: warning: format '%f' expects argument of type 'float*', but argument 3 has type 'double*' [-Wformat=]
    7 |         scanf("%f,%f,%s",&a,&b,&op);
      |                   ~^        ~~
      |                    |        |
      |                    float*   double*
      |                   %lf
foo.cc:14:15: warning: 'ans' may be used uninitialized [-Wmaybe-uninitialized]
   14 |         printf("%.2f",ans);
      |         ~~~~~~^~~~~~~~~~~~
foo.cc:5:16: note: 'ans' was declared here
    5 |     double a,b,ans;
      |                ^~~
正在同步测试数据,请稍后
[Hydro](https://hydro.ac)提供评测服务
# 状态 耗时 内存占用
#1 Wrong Answer Read 0.00, expect 5.90. 4ms 284.0 KiB
#2 Wrong Answer Read 0.00, expect 1.00. 4ms 284.0 KiB
#3 Wrong Answer Read 0.00, expect 6.00. 3ms 412.0 KiB
#4 Wrong Answer Read 1.00, expect 0.67. 3ms 412.0 KiB
#5 Accepted 3ms 412.0 KiB

信息

递交者
类型
递交
题目
P1029 简单计算器
语言
C++
递交时间
2023-11-02 17:33:53
评测时间
2023-11-02 17:33:53
评测机
分数
20
总耗时
19ms
峰值内存
412.0 KiB