问题标题: 酷町堂:3711哪错了?

0
0
卞士好
卞士好
中级守护
中级守护
#include<iostream>
#include<cstdio>
using namespace std;
int main()
{
    long long a,b;
    double c,d;
    cin>>a>>b>>c>>d;
    cout<<(long long)a*b/2<<endl;
    printf("%.3f",(c+d)*2);
    cout<<endl;
    printf("%.4f",c*d);
    cout<<endl;
    return 0;
}

 


0
0
王语哲
王语哲
中级守护
中级守护

还得给他任何试图然后天天

0
0
0
杨子恒
杨子恒
初级守护
初级守护
  • long long a,b;
  • double c,d;
  • cin>>a>>b>>c>>d;
  • cout<<a*b/2<<endl;
  • cout<<(c+d)*2.0;
  • cout<<endl;
  • printf("%.4f",c*d);
  • cout<<endl;
0
朱优扬
朱优扬
中级天翼
中级天翼

1、(c+d)*2不用保留小数,用cout即可

2、a*b/2不用强转,直接a*b/2就行了

 

0
0
黄硕梁
黄硕梁
初级天翼
初级天翼

printf

加上#include<cstdio>

0
桑烁
桑烁
高级光能
高级光能

a,b也有可能是小数,输出用整数long long也行

0
杨睿
杨睿
修练者
修练者

 cout<<(long long int)(a*b/2)<<endl;
    printf("%.3f\n",(x+y)*2);
    printf("%.4f\n",x*y);

我要回答