题解 1072: 汽水瓶

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

筛选

汽水瓶,简单递归法

摘要:解题思路:注意事项:参考代码:#include"bits/stdc++.h" using namespace std; // 全局变量,用于记录最终结果,及换了多少汽水喝 int c=0; v……

用小学生思路解决此题

摘要:解题思路:枚举注意事项:参考代码:#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……

递归思想解题

摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std;int s=0;int F(int n){    if(n<2){        return……

汽水瓶(dfs法)

摘要: import java.util.Scanner; public class Main { static int dfs(int n){ ……