题解 2822: 求分数序列和

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

筛选

求分数序列和

摘要:解题思路:注意事项:参考代码:n = int(input())q = 2p = 1s = 0for i in range(n):    s += q/p    t = q    q = p + q  ……

注意q和p不能放在整数型里

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

2025/8/3刷题记录

摘要:解题思路:通过sum记录累加和 int c记录原始b b=a+b后保证 a能赋值原始b注意事项:参考代码:#include<stdio.h>int main(){ ……