题解分享
题解分享简介
啤酒和饮料(结果填空) - 题解
$答案是11吗?$
```
#include<iostream>
#include<cstring>
#include<algorithm>
using namespace std;
int main()
{
for(int i=1;i<44;i++)
for(int j=i+1;j<44;j++)
{
double sum=0.0;
if(i*2.3+j*1.9==82.3)
{
cout<<i<<endl;
return 0;
}
}
return 0;
}
```
查看全文
0
0
0
5
啤酒和饮料(结果填空) - 题解
```cpp
#include <cstdio>
#include <cmath>
#include <iostream>
using namespace std;
using ll = long long;
int main() {
double pj = 2.3, yl = 1.9;
// 啤酒比饮料少
for (int i = 0; pj * i <= 82.3; ++i) {
for (int j = i + 1; pj*i + yl*j <= 83; ++j) {
if (pj*i + yl*j == 82.3) {
printf("%d * %.2f + %d * %.2f = %.3f\n", i, pj, j, yl, pj*i + yl*j);
}
}
}
return 0;
}
```
查看全文
0
0
0
0
啤酒和饮料(结果填空) - 题解
提交11不AC的
该题目有问题,要求提交的是买啤酒的数量,但实际测试的是啤酒数量+饮料数量。
一开始我提交的也是11,改题判错,然后我就试了一下提交“11 30”,然后就AC了
0
0
0
0



