主站
DreamJudge
院校信息
专业题库
模拟考试
机试真题
专业课程
讨论区
兑换中心
登录
注册
发布
以下题解仅供学习参考使用。
抄袭、复制题解,以达到刷AC率/AC数量或其他目的的行为,在N诺是严格禁止的。
N诺非常重视学术诚信。此类行为将会导致您成为作弊者。具体细则请查看N诺社区规则。
2018024342
2024年3月30日 14:51
喝饮料 题有没有佬给看看通过率为什么只有40
P1478
回复 4
|
赞 0
|
浏览 255
#include <bits/stdc++.h> using namespace std; struct node{ double m,l; }p[1111]; bool cmp(node a,node b){ return a.m/a.l<b.m/b.l; } int main(){ int x,n; while(scanf("%d%d",...
RingoCrystal
2024年3月31日 11:20
喝饮料 题解:每毫升的单价低者先喝
P1478
回复 0
|
赞 0
|
浏览 142
#include <bits/stdc++.h> using namespace std; struct node{ float mi; float wi; float good; node(float a,float b,float c){ mi=a; wi=b; good=c; }; }; bool rule(node a,node b){ return a.good<b.good; }; int main(){ float x; int n; while(cin>>x&g...
jenosa
2024年3月20日 10:18
喝饮料 题解:
P1478
回复 0
|
赞 1
|
浏览 350
坑点1,可以0元购 #include<iostream> #include<algorithm> using namespace std; struct node { double m; double w; double pri; }; bool cmp(node a,node b){ return a.pri < b.pri; } int main(){  ...
15240928957
2024年3月17日 15:52
喝饮料 题解:Runtime Error怎么回事
P1478
回复 3
|
赞 0
|
浏览 178
#include <iostream> #include <algorithm> using namespace std; struct node { double m, w; }p[1005]; bool cmp(node a, node b) { return a.m / a.w > b.m / b.w; } int main() { int x, n; while (...
光明守护神
2024年3月17日 21:38
只有你够有钱,是可以全喝完的!
P1478
回复 0
|
赞 0
|
浏览 195
#include<algorithm> #include<iomanip> #include <ios> #include<iostream> #include<vector> using namespace std; struct drink { float m; float w; float good; }; bool compare(drink a, drink b) { return a.good > b.good; } int main() { int...
easymoney
2024年3月17日 11:28
喝饮料 题解:(60%)
P1478
回复 1
|
赞 0
|
浏览 235
#include <stdio.h> #include <iostream> #include <algorithm> #include <string> #include <map> using namespace std; struct goods{ double mi; double wi; }; bool ascd(goods a,goods b){ return a.wi/a.mi < b.wi/b.mi ; } int main(){ int x,n; dou...
fzh
2024年3月16日 15:12
喝饮料 题解:就直接做呗
P1478
回复 0
|
赞 0
|
浏览 189
#include<bits/stdc++.h> using namespace std; typedef struct Drink { int ml; int price; }; bool cmp(Drink* a, Drink* b) { if (((float)a->ml / a->price) < ((float)b->ml / b->price) ) return false; &n...
LI1
2024年3月15日 20:25
喝饮料 题解:按每元多少毫升排序,要从大到小
P1478
回复 0
|
赞 0
|
浏览 180
#include<stdio.h> #include<stdlib.h> struct milk { double mi; double wi; }; void sort(struct milk S[],int n) { int i,j; for(i=0;i<n;i++) { &nbs...
LI1
2024年3月13日 21:51
喝饮料 题解:只有60%实在是没调试出来
P1478
回复 2
|
赞 0
|
浏览 250
#include<stdio.h> #include<stdlib.h> struct milk { int mi; int wi; }; void sort(struct milk S[],int n) { int i,j; for(i=0;i<n;i++) { for(...
GGboom
2024年3月14日 15:05
喝饮料 题解:C++每毫升单价排序,注意题目的结束判定
P1478
回复 0
|
赞 0
|
浏览 283
#include<iostream> #include<algorithm> using namespace std; class Water { public: double price; double howmany; double danjia; Water() {} void setWater(double a, double b) { ...
1
2
3
题目
喝饮料
题解数量
23
发布题解
热门题解
1
喝饮料 题解:贪心,按照性价比最高的方式来买饮料
2
喝饮料 题解:
3
喝饮料 题解:
4
#贪心 #sort
5
喝饮料 题解:c++版 sort函数 结构体数组
6
喝饮料 题有没有佬给看看通过率为什么只有40
7
喝饮料 题解:每毫升的单价低者先喝
8
喝饮料 题解:就直接做呗
9
____
10
通过率60%?求大佬解释哪里出错