1072-嵌套循环求解 摘要:解题思路:#创建两个变量分别记录空瓶子数和兑换汽水数 #使用循环体实现对多个数据的接收 #注意计算每次进行兑换后剩余空瓶子数注意事项:sum每次输出后要重新归零n=2时便只能再兑换最后一瓶参考代码…… 题解列表 2022年11月03日 0 点赞 0 评论 102 浏览 评分:0.0
Work out the bottle problem 摘要:解题思路:注意题目给的信息,空杯子是3的倍数,就对获得的空杯子进行取余直到为2或0注意事项:时间的开销,当小于2时直接退出参考代码:#include<stdio.h>int main(){ int n…… 题解列表 2022年12月22日 0 点赞 0 评论 84 浏览 评分:0.0
(c语言)详细解读,算法简单易懂 摘要:解题思路:注意事项:参考代码:#include"stdio.h" void main(){ int battle=0,full=0,sum=0; //分别对应空瓶,满瓶,换到的数量 …… 题解列表 2023年01月03日 0 点赞 0 评论 84 浏览 评分:0.0
一切尽在代码中 摘要:解题思路:注意事项:参考代码:#include <stdio.h>#define N 100int duihuan(int x) { int rest_kpz, qishui_total, ne…… 题解列表 2023年01月03日 0 点赞 0 评论 102 浏览 评分:0.0
简单版汽水瓶代码 摘要:解题思路:注意事项:参考代码:#include <stdio.h>int main(){ int i = 0; for(i=0;i<10;i++) { int a = …… 题解列表 2023年01月05日 0 点赞 0 评论 96 浏览 评分:0.0
必过码可带走短码 摘要:解题思路:原题链接:汽水瓶解题思路:根据老板可以借水,可以变相理解为使用2个空瓶和老板换一瓶水,代码改写为参考代码:while 1: t=int(input()) if t == 0: …… 题解列表 2023年01月12日 0 点赞 0 评论 127 浏览 评分:0.0
汽水瓶(python代码) 摘要:def printf(x): total = 0 c = x//3 total = total+c d = x%3 x = d+c   题解列表 2023年01月16日 0 点赞 0 评论 92 浏览 评分:0.0
非常基础的方式 摘要:解题思路:注意事项:参考代码:#include <stdio.h>int main(){ int i,j; int arr[100] = { 0 }; for (i = 0; i < 100; i+…… 题解列表 2023年02月10日 0 点赞 0 评论 119 浏览 评分:0.0
汽水瓶——三个空瓶换一瓶汽水 摘要:解题思路:稍微列一下,就很容易发现空瓶数与汽水数之间的关系注意事项:参考代码:for i in range(10): a = int(input()) if a == 0: …… 题解列表 2023年03月15日 0 点赞 0 评论 132 浏览 评分:0.0
1072: 汽水瓶 摘要:解题思路:注意事项:参考代码:#include<iostream> #include<cstring> #include<cmath> #include<algorithm> #include…… 题解列表 2023年03月26日 0 点赞 0 评论 111 浏览 评分:0.0