这道题中点是在小数上,因为成绩可能是:“95.5 87.7……”所以我们就要用:printf和scanf这样就可以控制小数了!!!
code:
#include<bits/stdc++.h>
/*#include<iostream>
#include<cstdio>*/ using namespace std; int main() { int a,b,c; int s; scanf("%d%d%d",&a,&b,&c); s=a*20/100+b*30/100+c*50/100; printf("%d",s); } /*#include<bits/stdc++.h> using namespace std; int main() { double a,b,c; double s; scanf("%lf%lf%lf",&a,&b,&c); s=a*0.2+b*0.3+c*0.5; printf("%.lf",s); } */