萌新急,在线等
by lmxasgy @ 2021-01-23 20:37:32
```
a*0.2 + a*0.3 + c*0.5?
```
by MZAutomata @ 2021-01-23 20:40:56
第二个不应该是b吗
by MZAutomata @ 2021-01-23 20:41:54
@[A_camel](/user/305073) 跪谢,鄙人不才
by lmxasgy @ 2021-01-24 17:01:34
@[WASGY1314](/user/372247) int s = (a/10)*2+(b/10)*3+(b/10)*5;
你那样写,得到的会带小数点“.0”
答案需要的是整数
by zhou少 @ 2021-04-16 17:26:49
@[zhou少](/user/418636) 跪谢
by lmxasgy @ 2021-04-17 18:24:51
``` cpp
#include<iostream>
using namespace std;
int main(){
int a,b,c,d,e,f;
cin>>a>>b>>c;
d=a/5;
e=b*30/100;
f=c/2;
cout<<d+e+f;
return 0;
}
```
O2 30ms
by xumengxing @ 2022-01-26 14:46:36
```
cout<<fixed<<setprecision(0)
```
注意:
```
#include<cmath>
#include<iomanip>
```
by yiheng0913_XDDDDDDDD @ 2022-05-06 17:44:44
标准正确代码,严禁复制!
```cpp
#include <iostream>
using namespace std;
int main() {
int a,b,c;
cin>>a>>b>>c;
cout<<a/5+b*3/10+c/2;
return 0;
}
```
by jyz120609 @ 2022-07-11 16:47:54
其實像以下程式碼不容易錯,還是比較簡便的
```
#include <iostream>
#include <cmath>
#include <iomanip>
using namespace std;
int main()
{
int a,b,c;
cin>>a>>b>>c;
cout<<a*0.2+b*0.3+c*0.5;
return 0;
}
```
by dcmzwy @ 2022-08-10 18:06:58