题目 1013: [编程入门]Sn的公式求和—常规求解方法 摘要:解题思路:比如n为4时,则Sn为2*10^0*4+2*10^1*3+2*10^2*2+2*10^3*1注意事项:指数用pow函数参考代码:#include<stdio.h> #include<mat…… 题解列表 2022年10月20日 0 点赞 0 评论 266 浏览 评分:0.0
规律拆分求解 摘要:解题思路: 规律拆分: 2,22 = 2*10 + 2 ,222= 22 * 10 + 2, 2222 = 222 * 10 + 2.。。。以此类推。注意事项: …… 题解列表 2022年10月22日 0 点赞 0 评论 226 浏览 评分:0.0
简单的fot循环语句即可 摘要:解题思路:注意事项:参考代码:# include <stdio.h>int main(void){ int a,n,i; int Sn; scanf("%d", &n); a = 0; Sn = 0;…… 题解列表 2022年10月25日 0 点赞 0 评论 242 浏览 评分:0.0
编写题解 1013: [编程入门]Sn的公式求和 摘要:解题思路:注意事项:参考代码:#include<stdio.h>#include<math.h>int main(){ int i,n,m=0,Sn=0; scanf("%d",&n); for(i=…… 题解列表 2022年11月22日 0 点赞 0 评论 211 浏览 评分:0.0
1013: [编程入门]Sn的公式求和(java代码) 摘要:解题思路:解法一:根据规律发现每一项数字都是前面一项的10倍+2(2,20+2, 220+2,.....)。解法二:把每一项数字拆开(2*100,(2*100+2*101),(2*100+2*101+…… 题解列表 2022年11月26日 0 点赞 0 评论 321 浏览 评分:0.0
C语言程序设计教程(第三版)课后习题6.3 (Java代码) 摘要:解题思路:注意事项:参考代码:import java.util.Scanner;public class Main { public static void main(String[] ars) { …… 题解列表 2022年11月30日 0 点赞 0 评论 257 浏览 评分:0.0
1013: [编程入门]Sn的公式求和 观察数的关系 摘要:解题思路:注意事项:222=22*10+2 22=2*10+2参考代码:#include<stdio.h>int main(){ int n,sum = 0,i,a =…… 题解列表 2022年12月24日 0 点赞 0 评论 208 浏览 评分:0.0
循环求和,一种简单的方法实现 摘要:解题思路:若 n = 5,设 变量 a = 0可推:2 = 2 x 1; (a)22 = 2 x 10 + 2 ( a = 2 * 10 + a)222 = 2 x 100 + 22 ( a = 2 …… 题解列表 2023年01月14日 0 点赞 0 评论 234 浏览 评分:0.0
Sn的公式求和 摘要:解题思路:在Sn中,加和项数由n决定,最后一项为‘2’*n,对n+1建立for循环依次得出Sn中每一项,最后加和。参考代码:n = int(input())m = 0for i in range(1,…… 题解列表 2023年01月15日 0 点赞 0 评论 308 浏览 评分:0.0
递归写法,新手尝试,欢迎优化 摘要:#include<stdio.h> #include<math.h> int Fun(int x) { while (x > 0) { return 2 * ((int)pow(1…… 题解列表 2023年02月01日 0 点赞 0 评论 168 浏览 评分:0.0