题解:AT_past18_b レーティング

· · 题解

又是一道水题

题意

给定两个数 R 和 P ,根据公式 R=⌊0.9×R+0.1×P⌋

求出计算后得到的 R 。(注意下舍入)

用 floor 函数取答案即可。(或者直接强制转换 int 类型)

代码


#include<bits/stdc++.h>
using namespace std;
double r,p;
int main(){
    cin>>r>>p;
    printf("%.0f",floor(0.9*r+0.1*p));
    return 0;
}