6 条题解
- 1
信息
- ID
- 1381
- 时间
- 1000ms
- 内存
- 256MiB
- 难度
- 3
- 标签
- 递交数
- 820
- 已通过
- 421
- 上传者
没啥可说的了,看注释吧
#include <bits/stdc++.h>
using namespace std;
double a,b,c;
int main()
{
int sum=0;
cin>>a>>b>>c;
a=a*0.2;//50%=100分之50=10分之5
b=b*0.3;//30%=100分之30=10分之3
c=c*0.5;//20%=100分之20=10分之2
sum=a+b+c;
cout<<sum;
return 0;//完美结束
}
```
```
习惯性写函数
#include<bits/stdc++.h>
using namespace std;
int homework,test,examinstion;
int mark(int a,int b,int c)
{
int sum = 0;
sum = a*0.2 + b*0.3 + c*0.5;
return sum;
}
int main()
{
cin>>homework>>test>>examinstion;
cout << mark(homework,test,examinstion);
return 0;
}
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n , a , b , c;
cin >> a >> b >> c;
a *= 0.2;
b *= 0.3;
c *= 0.5;
n = a + b + c;
cout << n;
return 0;
}
A
泰裤辣!!!👍
#include <bits/stdc++.h>
using namespace std;
int main(){
int a,b,c,x;
cin >> a >> b >> c;
x = a * 0.2 + b * 0.3 + c * 0.5;
cout << x;
return 0;
}
#include <bits/stdc++.h>
using namespace std;
double a, b, c;
int main()
{
cin >> a >> b >> c;
a *= 0.2; //20% = 0.2
b *= 0.3; //30% = 0.3
c *= 0.5; //50% = 0.5
cout << a + b + c; //输出总和
return 0;
}