全部评论
最后一道题一波操作猛如虎,一看通过十点五。还不如我直接return 0;45%它不香嘛
数据方向的。。这回比第一次简单很多但还是只有2.06。。最后一个sql题怎么看怎么没问题不知道为啥只有50%
前端无线方向 题目和你们发的不一样
int buyCoke(int m, int a, int b, int c, int x) { int res = 0; while(m > 0) { if (c > 0 && c * 100 >= x) { c -= x / 100; res += x / 100; if (x % 100 != 0) { c -= 1; res++; } b += x % 100 / 50; a += x % 100 % 50 / 10; } else if (b > 0 && c * 100 + b * 50 >= x) { b -= (x - c * 100) / 50; res += (x - c * 100) / 50; res += c; if ((x - c * 100) % 50 != 0) { b -= 1; res++; } c = 0; a += (x - c * 100) % 50 / 10; } else if (a > 0 && b * 50 + a * 10 >= x) { a -= (x - b * 50) / 10; res += (x - b * 50) / 10; res += b; b = 0; } m--; } return res; }
大佬可以发一波题解吗
相关推荐
09-13 10:40
门头沟学院 Java Silencer76:输入输出练习题单,请https://www.nowcoder.com/exam/oj?page=1&tab=%E7%AE%97%E6%B3%95%E7%AC%94%E9%9D%A2%E8%AF%95%E7%AF%87&topicId=372

点赞 评论 收藏
分享