题解 1013: [编程入门]Sn的公式求和 摘要:解题思路:用字符存‘2’然后转换,再相加注意事项:list的赋值,字符(字符串)乘参考代码:n = int(input())'''num = {} #用字典解决下标溢出for …… 题解列表 2022年04月02日 0 点赞 0 评论 362 浏览 评分:0.0
1013sn的公式求和 摘要:解题思路:要善于发现2,22,222.....之间的规律每次都是拿前面的数乘10再加2注意事项:参考代码:#include<stdio.h>int main(){ int a=2,n,sum=0; s…… 题解列表 2022年04月02日 0 点赞 0 评论 279 浏览 评分:9.9
[编程入门]Sn的公式求和 摘要:解题思路: 1.按照题目的意思此题肯定要用循环,然后我们要在题目所给的公式找一种方法求解,(可能比较考验你的数学能力) 2.求Sn=a+aa+aaa+……… 题解列表 2022年04月02日 0 点赞 0 评论 659 浏览 评分:9.9
我不理解!!!! 摘要: #include int func(int a); int main(){ int a; scanf("%d",&a); int i; …… 题解列表 2022年03月31日 0 点赞 0 评论 322 浏览 评分:0.0
Sn的公式求和 摘要:解题思路:定义一个求和函数,在调用该函数计算Sn注意事项:。参考代码:#define _CRT_SECURE_NO_WARNINGS#include<stdio.h>int fun(int n){ …… 题解列表 2022年03月30日 0 点赞 0 评论 282 浏览 评分:0.0
最普通的方法 摘要:解题思路注意事项:参考代码:#include<stdio.h>int main(){ int a=2,i=0,sum=0; int n; scanf("%d",&n); while(n>0) { s…… 题解列表 2022年03月29日 0 点赞 0 评论 380 浏览 评分:9.9
Sn的公式求和题解(C语言代码) 摘要:解题思路:首先要明白运用的语句 肯定是while循环 然后在用公式代换出来 Sn=2+22+222+2222+... 可以理解为 n个2加上(n-1)个20 加上(n-2)个200 一直加到 1*…… 题解列表 2022年03月29日 0 点赞 0 评论 443 浏览 评分:0.0
有手就行之Sn的公式求和 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main() { int n,a=2,i,s=2; scanf("%d",&n); for(i=1; i<n; i++) { …… 题解列表 2022年03月27日 0 点赞 1 评论 540 浏览 评分:9.9
[编程入门]Sn的公式求和(python基本解法) 摘要:解题思路:利用append函数构造列表求解注意事项:提前对所需参数进行赋值参考代码:n = int(input())Sn = 0s = 0a = 2S = []for i in range(n): …… 题解列表 2022年03月14日 0 点赞 0 评论 547 浏览 评分:0.0
仅用简单的while循环求Sn的公式求和 摘要:解题思路: 由题目可知a=2,且n=1时是一个a,为2,n=2时为两个a,为22 由此我们可以得出当 n=k (k为自然数)时,有k个a,即22222.....2 (k个2) …… 题解列表 2022年03月04日 0 点赞 0 评论 373 浏览 评分:9.9