利用循环得到n次的数字,然后求和 摘要:解题思路:每次循环把上一个值乘10再加上结尾的2注意事项:跳出循环后还需要再算一次和参考代码:int main(){ int a=2,n;&…… 题解列表 2025年02月25日 0 点赞 0 评论 78 浏览 评分:0.0
[编程入门]Sn的公式求和-题解(C语言代码) 摘要:```c #include #include #include double digui(double n) { double a=2; if(n==1) a=2; …… 题解列表 2020年02月02日 0 点赞 0 评论 382 浏览 评分:0.0
C语言程序设计教程(第三版)课后习题6.3 (C语言代码) 摘要:解题思路:注意事项:参考代码:#include<stdio.h>#include<math.h>int main(){ int n,i=0,x=0,j=0; scanf("%d",&n);…… 题解列表 2018年02月22日 0 点赞 0 评论 617 浏览 评分:0.0
看清规律,速解Sn求和问题 摘要:解题思路:找规律,有n项,就有n个2,n-1个20,n-2个200,以此类推,最后是一个2*10e(n-1)。注意事项:注意最开始i的取值参考代码:#include<stdio.h>#include<…… 题解列表 2021年10月27日 0 点赞 0 评论 105 浏览 评分:0.0
[编程入门]Sn的公式求和-题解(C++代码) 摘要:简单的嵌套循环 ```cpp #include using namespace std; int n,sum,cnt,day; int main(){ cin>>n; for(int…… 题解列表 2021年02月05日 0 点赞 0 评论 103 浏览 评分:0.0
Sn的公式求和 摘要:解题思路:先推导每次加的式子之间的关系,可以发现是2,22,222......,可以知道an=an-1*10+2,然后加到Sn上面即可注意事项:1.要给Sn和an都赋初值,我最开始就忘记给an赋初值了…… 题解列表 2021年03月12日 0 点赞 0 评论 328 浏览 评分:0.0
[编程入门]Sn的公式求和 (C语言代码) 摘要:标准库函数#include <math.h>double pow(double x,double y):计算xy的值 参考代码:#include<stdio.h> #include <math.…… 题解列表 2019年04月23日 0 点赞 0 评论 567 浏览 评分: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 评论 103 浏览 评分:0.0
[编程入门]Sn的公式求和-题解(C++代码) 摘要:解题思路:将数字理解为字符,再将字符转换为数字相加注意事项:参考代码:#include<bits/stdc++.h> #include<string> using namespace std; …… 题解列表 2020年08月16日 0 点赞 0 评论 286 浏览 评分:0.0
[编程入门]Sn的公式求和-题解(C语言代码) 摘要:```java import java.util.Scanner; /** * https://www.dotcpp.com/oj/problem1013.html * @author…… 题解列表 2019年07月31日 0 点赞 0 评论 736 浏览 评分:0.0