1013: [编程入门]Sn的公式求和 摘要:解题思路:注意事项:参考代码:#include<stdio.h> int main() { int a=2, Sn=0, n, i; scanf("%d\n",&n); …… 题解列表 2022年02月13日 0 点赞 0 评论 168 浏览 评分:0.0
1013: [编程入门]Sn的公式求和 摘要:解题思路:利用字符串和eval()函数注意事项:参考代码:Sn = 0n = eval(input())for i in range(1, n+1): Sn += eval('2'…… 题解列表 2022年02月20日 0 点赞 0 评论 186 浏览 评分:0.0
Sn的公式求和 摘要:解题思路:注意事项:参考代码:#include<stdio.h>#include<math.h> …… 题解列表 2022年02月21日 0 点赞 0 评论 151 浏览 评分:0.0
编写题解 1013: [编程入门]Sn的公式求和--解题 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main (){ int n,An=0,Sn=0; scanf("%d",&n); while(n!=0){ …… 题解列表 2022年03月04日 0 点赞 0 评论 164 浏览 评分:0.0
[编程入门]Sn的公式求和(python基本解法) 摘要:解题思路:利用append函数构造列表求解注意事项:提前对所需参数进行赋值参考代码:n = int(input())Sn = 0s = 0a = 2S = []for i in range(n): …… 题解列表 2022年03月14日 0 点赞 0 评论 390 浏览 评分:0.0
Sn的公式求和题解(C语言代码) 摘要:解题思路:首先要明白运用的语句 肯定是while循环 然后在用公式代换出来 Sn=2+22+222+2222+... 可以理解为 n个2加上(n-1)个20 加上(n-2)个200 一直加到 1*…… 题解列表 2022年03月29日 0 点赞 0 评论 319 浏览 评分:0.0
Sn的公式求和 摘要:解题思路:定义一个求和函数,在调用该函数计算Sn注意事项:。参考代码:#define _CRT_SECURE_NO_WARNINGS#include<stdio.h>int fun(int n){ …… 题解列表 2022年03月30日 0 点赞 0 评论 141 浏览 评分:0.0
我不理解!!!! 摘要: #include int func(int a); int main(){ int a; scanf("%d",&a); int i; …… 题解列表 2022年03月31日 0 点赞 0 评论 189 浏览 评分:0.0
题解 1013: [编程入门]Sn的公式求和 摘要:解题思路:用字符存‘2’然后转换,再相加注意事项:list的赋值,字符(字符串)乘参考代码:n = int(input())'''num = {} #用字典解决下标溢出for …… 题解列表 2022年04月02日 0 点赞 0 评论 247 浏览 评分:0.0
用math.h库里面的pow函数实现x的n次方效果。求Sn=a+aa+aaa+…+aa…aaa(有n个a)之值,其中a是一个数字,为2。 例如,n=5时=2+22+222+ 摘要:解题思路: S1=2,S2=22+2,S3=222+22+2; S3=S2+2*pow(10,2)+2*pow(10,1)+2*pow(10,0); 得出:S=S+2*pow(10,j)用math.…… 题解列表 2022年04月08日 0 点赞 0 评论 530 浏览 评分:0.0