题解 1013: [编程入门]Sn的公式求和

来看看其他人写的题解吧!要先自己动手做才会有提高哦! 
返回题目 | 我来写题解

筛选

最短代码解决

摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){    int a,n;    scanf("%d",&n);    a = 24690;    printf("……

[编程入门]Sn的公式求和

摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int n,i,sum=0,a=0; scanf("%d",&n); for(i=0;i<n;i++){ a=……

1013: [编程入门]Sn的公式求和

摘要:解题思路:注意事项:参考代码:#include<stdio.h> int main() {     int a=2, Sn=0, n, i;     scanf("%d\n",&n);   ……

1013: [编程入门]Sn的公式求和

摘要:解题思路:利用字符串和eval()函数注意事项:参考代码:Sn = 0n = eval(input())for i in range(1, n+1):    Sn += eval(&#39;2&#39……

Sn的公式求和

摘要:解题思路:注意事项:参考代码:#include<stdio.h>#include<math.h>                                                    ……

Sn的公式求和题解(C语言代码)

摘要:解题思路:首先要明白运用的语句  肯定是while循环 然后在用公式代换出来 Sn=2+22+222+2222+... 可以理解为 n个2加上(n-1)个20 加上(n-2)个200  一直加到 1*……

Sn的公式求和

摘要:解题思路:定义一个求和函数,在调用该函数计算Sn注意事项:。参考代码:#define _CRT_SECURE_NO_WARNINGS#include<stdio.h>int fun(int n){  ……