Evanyou Blog 彩带
扩大
缩小

NOIP 成绩

这道题中点是在小数上,因为成绩可能是:“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); } */

 

posted @ 2018-12-08 17:25  yi_heng  阅读(266)  评论(0编辑  收藏  举报