高斯求和 (c++代码) 摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;int n;int main(){ cin>>n; int s=(1+n)*n/2;…… 题解列表 2023年02月22日 0 点赞 0 评论 315 浏览 评分:9.9
累加求和简短版 摘要:解题思路:注意事项:sum一定要初始化为0参考代码:#include<stdio.h>int main(){ int n,sum=0; scanf("%d",&n); int i; for(i=1;i…… 题解列表 2023年01月18日 0 点赞 0 评论 536 浏览 评分:9.9
2544: N以内累加求和(高斯) 摘要:##N以内累加求和(高斯) ####还记得那个口号吗? ######首项加末项乘以项数除以二,我记得我上小学奥数第一节课教的就是这个,好怀念:tw-1f31f: ```c #include …… 题解列表 2022年12月31日 0 点赞 0 评论 415 浏览 评分:9.9
N以内累加求和 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int n,i,s=0; scanf("%d",&n); for(i=0;i<=n;i++) …… 题解列表 2022年12月25日 0 点赞 0 评论 228 浏览 评分:0.0
N以内累加求和 摘要:解题思路:就是一个简单的循环注意事项:参考代码#include<stdio.h>int main(){ int a,b; scanf("%d",&a); int i; b=0;…… 题解列表 2022年11月12日 0 点赞 0 评论 455 浏览 评分:9.9
2544一行解(Python) 摘要:注意事项:用sum直接计算列表中的值得和,input()得到的内容为str类型,range(N,M)左闭右开参考代码:print(sum(range(int(input())+1)))…… 题解列表 2022年11月06日 0 点赞 0 评论 292 浏览 评分:9.9
2544: N以内累加求和 摘要:解题思路:注意事项:参考代码:#include <stdio.h> int main() { int n = 0, s = 0; scanf("%d", &n); …… 题解列表 2022年10月14日 0 点赞 0 评论 257 浏览 评分:0.0
2544——————N以内累加求和 摘要: n = int(input()) #凑字数凑字数凑字数凑字数凑字数凑字数凑字数凑字数 sum = 0 #初始化为0 for i in range(n+1): #循环…… 题解列表 2022年07月07日 0 点赞 0 评论 298 浏览 评分:0.0
2544: N以内累加求和,C++ 摘要:解题思路:do while求累加注意事项:参考代码:#include <iostream>using namespace std;int main(){ int n; int sum=0;…… 题解列表 2022年06月07日 0 点赞 0 评论 387 浏览 评分:9.9
累加求和 for循环 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int a,sum=0,y; scanf("%d",&a); for (y=1;y<=a;y++) …… 题解列表 2021年11月07日 0 点赞 0 评论 488 浏览 评分:6.0