python解决蟠桃记 摘要:解题思路:递归即可参考代码:def PanTao(n, sum): if n == 1: return sum else: sum =&n 题解列表 2021年04月07日 0 点赞 0 评论 766 浏览 评分:6.0
1171: 蟠桃记 摘要:解题思路:从最后一天往前推注意事项:参考代码:while True: n=int(input()) s=1 for i in range(n-1): s=(s+1)*2…… 题解列表 2021年11月01日 0 点赞 0 评论 683 浏览 评分:0.0
编写题解 1171: 蟠桃记 摘要:解题思路:注意事项:参考代码:#include<stdio.h> int num(int a); int main(){ int a,b; while(scanf("%d",&a)!=EO…… 题解列表 2021年11月09日 0 点赞 0 评论 504 浏览 评分:9.9
蟠桃记(递归法,没啥难的了) 摘要:解题思路:递归算法,用函数来表示比较容易。注意事项:参考代码:#includeint sum(int n);int sum(int n){ int total; if(n==1) return 1;…… 题解列表 2021年11月26日 0 点赞 0 评论 630 浏览 评分:0.0
蟠桃记——题解 ```c++#includeusingnamespacestd;intp(intx){inty=(x+1)*2;returny;}intmain(){//设y为第s天的蟠桃数,x为s-1天的蟠桃数//则有y=(x+1)*2//最后一天只有1只intn, 题解列表 2022年01月28日 0 点赞 0 评论 773 浏览 评分:9.9
Hisipfysta-1171-蟠桃记(C++代码) 解题思路:```math\begin{cases}a_1=1\\a_2=2(a_1+1)=4\\a_3=2(a_2+1)=10\\\cdots\\a_n=(a_{n-1}+1)\\\end{cases}```代码如下:```cpp#includeusingnamespacestd;inta_(intn 题解列表 2022年02月05日 0 点赞 0 评论 651 浏览 评分:9.9
编写题解 1171: 蟠桃记 摘要:解题思路:注意事项:参考代码:while True: try: n=int(input()) ls=[1] for i in&nb 题解列表 2022年02月17日 0 点赞 0 评论 469 浏览 评分:0.0
编写题解 1171: 蟠桃记 摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std;int main(){ int n; while(cin>>n){ …… 题解列表 2022年03月28日 0 点赞 0 评论 695 浏览 评分:0.0
逆向思维求解(简洁易懂) 解题思路:首先设开始时有x个桃,根据题意,以后每天吃一半多一个有x=x/2-1,则输出部分就可以写为x=2*(x+1)注意事项:多个输入输出时在输入位置,要注意处理文件末尾参考代码:#includeintmain(){intn;while(scanf("%d", 题解列表 2022年10月27日 0 点赞 0 评论 694 浏览 评分:9.9
C++超级简单的基础题解 摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std;int main(){ int sum = 1; int n; while …… 题解列表 2022年11月02日 0 点赞 0 评论 479 浏览 评分:0.0