题解:P1421 小玉买文具
Make_China_Great · · 题解
思路
根据我们不能买半支铅笔,可以知道,题意是让我们求
于是,我们直接运用 floor 函数下取整并输出结果即可。
但各位请注意一定要开 double ,别写成 int 了。
代码
#include<bits/stdc++.h>
using namespace std;
int main(){
double a,b;
cin>>a>>b;
cout<<floor((a+b/10)/1.9);
}