题解 1072: 汽水瓶

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

筛选

拿汽水瓶换汽水

摘要:解题思路: 首先仔细阅读题目可以得知在拥有一定瓶子数的情况下,每当有三个瓶子就可以换一瓶汽水,所以第一个能想到的是用瓶子数取3的整除得到换取的汽水数,那么将其喝掉后会得到新的瓶子,只需与原……

题解 1072: 汽水瓶,递归

摘要:解题思路:注意事项:参考代码:#include <stdio.h>int num;//可以喝的汽水数量void fun(int len) {//len是空瓶子数量 ……

简单易懂 给个赞 嘻嘻

摘要:解题思路:注意事项:参考代码:#include<stdio.h>void fact(int n);int main(){ int n; // n 是空的汽水瓶 while (1) { s……

while循环的简单使用

摘要:解题思路:注意事项:参考代码:#include <stdio.h>int x(int n) {    int sum = 0;    if (n < 2) return 0;     while (n……

用小学生思路解决此题

摘要:解题思路:枚举注意事项:参考代码:#include<stdio.h>int main(){ int a[10];int i=0,m=1;while(m){    scanf("%d",&a[i]); ……

汽水瓶:第二种解法

摘要:解题思路:注意事项:参考代码:#include <stdio.h>#include <string.h>int main(){ int n,b,a,m,j=0; while(scanf("%d",&n……

汽水瓶:n/2

摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){    int i=-1,j,n[100];    do{        scanf("%d",&n[++i]);……

逆天解法,包得吃的。

摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int n; while(~scanf("%d",&n)) { int b,a=0,c=0; if(n……