1013: [编程入门]Sn的公式求和 摘要:解题思路:注意事项:参考代码:def sno(i): stable = 2 output = 0 while i >…… 题解列表 2025年01月20日 0 点赞 0 评论 990 浏览 评分:0.0
Sn的公式求和 摘要:解题思路:首先需要定义两个变量,一个变量用来存储和,sum,另一个变量用来存每次计算的结果 term,由于a的值始终为2,所以每次计算后都需要在原来的结算结果的基础上进位并加2.注意事项:参考代码:#…… 题解列表 2025年01月26日 0 点赞 0 评论 1149 浏览 评分:0.0
1013,for循环解决 摘要:#######includeint main(){ int a=2,n,term=0,sum=0,i; scanf("%d",&n); for(i=1;i…… 题解列表 2025年02月09日 9 点赞 0 评论 1506 浏览 评分:0.0
利用循环得到n次的数字,然后求和 摘要:解题思路:每次循环把上一个值乘10再加上结尾的2注意事项:跳出循环后还需要再算一次和参考代码:int main(){ int a=2,n;&…… 题解列表 2025年02月25日 2 点赞 0 评论 1206 浏览 评分:0.0
利用数学函数库和两个for循环解题 摘要:解题思路:注意事项:参考代码:#include<math.h>#include<stdio.h>int main(){ int n,i,j,sum=0…… 题解列表 2025年11月03日 0 点赞 1 评论 342 浏览 评分:0.0
慢慢看,慢慢理解,你也能做到, 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int a=0,n=0;int answer=0;int main(){ …… 题解列表 2025年11月04日 1 点赞 0 评论 418 浏览 评分:0.0
构造数字并累加C语言 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int n; scanf("%d",&n); int a=2; int …… 题解列表 2026年01月14日 1 点赞 0 评论 324 浏览 评分:0.0
通过递归求解,时间复杂度过高 摘要:解题思路:注意事项:时间复杂度是O(2ⁿ)参考代码:#include<stdio.h>intsum(intn){&nbs…… 题解列表 2026年01月30日 0 点赞 0 评论 440 浏览 评分:0.0
1013基础解法(简短输出) 摘要:题目:求Sn=a+aa+aaa+…+aa…aaa(有n个a)之值,其中a是一个数字,为2。 例如,n=5时=2+22+222+2222+22222,n由键盘输入。解题关键点:1:已知a=2,Sn为所求…… 题解列表 2026年05月11日 0 点赞 0 评论 157 浏览 评分:0.0
极简解法(C语言) 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int n,sum=0,a=0; scanf("%d",&n); for…… 题解列表 2026年06月15日 0 点赞 0 评论 121 浏览 评分:0.0