题解 1072: 汽水瓶

来看看其他人写的题解吧!要先自己动手做才会有提高哦! 
返回题目 | 我来写题解

筛选

求汽水瓶的数量

摘要:解题思路:注意事项:参考代码:#include<stdio.h>int number(int emptyglass){    /*求解空汽水瓶能换多少瓶水*/    int fullglass,all……

1072-嵌套循环求解

摘要:解题思路:#创建两个变量分别记录空瓶子数和兑换汽水数 #使用循环体实现对多个数据的接收 #注意计算每次进行兑换后剩余空瓶子数注意事项:sum每次输出后要重新归零n=2时便只能再兑换最后一瓶参考代码……

Work out the bottle problem

摘要:解题思路:注意题目给的信息,空杯子是3的倍数,就对获得的空杯子进行取余直到为2或0注意事项:时间的开销,当小于2时直接退出参考代码:#include<stdio.h>int main(){ int n……

一切尽在代码中

摘要:解题思路:注意事项:参考代码:#include <stdio.h>#define N 100int duihuan(int x) {    int rest_kpz, qishui_total, ne……

简单版汽水瓶代码

摘要:解题思路:注意事项:参考代码:#include <stdio.h>int main(){    int i = 0;    for(i=0;i<10;i++)    {        int a = ……

必过码可带走短码

摘要:解题思路:原题链接:汽水瓶解题思路:根据老板可以借水,可以变相理解为使用2个空瓶和老板换一瓶水,代码改写为参考代码:while 1:    t=int(input())    if t == 0:  ……

汽水瓶(python代码)

摘要:def printf(x):     total = 0     c = x//3     total = total+c     d = x%3     x = d+c  

非常基础的方式

摘要:解题思路:注意事项:参考代码:#include <stdio.h>int main(){ int i,j; int arr[100] = { 0 }; for (i = 0; i < 100; i+……