T1020 猴子偷桃
摘要:解题思路:注意事项:参考代码:n=int(input())def f(n): s=1 while n-1: ……
1020: [编程入门]猴子吃桃的问题
摘要:解题思路:注意事项:注意count要从1开始,因为假设有10个桃子,第一天吃了5+1个,余4个;那第二天吃了2+1个,余1个;第三天想吃的时候是发现只有1个了,所以这这里要多1参考代码:public ……
数学方法-推公式---------
摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std;int main(){ int n; &nb……
猴子吃桃。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。
摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;int main(){ int m,n;&nb……
1020: [编程入门]猴子吃桃的问题
摘要:解题思路:注意事项:参考代码:n=int(input())output=1for i in range(1,n): output=(output+1)*2print(outp……
递归7行解决猴子吃桃
摘要:参考代码:n=eval(input())def peach(m): if m==n: return 1 else: return 2*(peach(m+1)+1……