首页
DreamJudge
院校信息
考研初试
考研复试
保研专区
讨论区
兑换中心
登录
注册
上岸
以下题解仅供学习参考使用。
抄袭、复制题解,以达到刷AC率/AC数量或其他目的的行为,在N诺是严格禁止的。
N诺非常重视学术诚信。此类行为将会导致您成为作弊者。具体细则请查看N诺社区规则。
xsw
2026年1月30日 09:34
求1到n的和 题解:
P1133
回复 0
|
赞 6
|
浏览 211
#include<iostream> using namespace std; int main() { int n; cin >> n; int sum = 0; for (int i = 1; i <= n; i ++) { sum += i; } cout << sum << endl; return 0; }
mlx
2026年1月28日 22:39
求1到n的和 题解:
P1133
回复 0
|
赞 1
|
浏览 125
#include<iostream> using namespace std; int work(int n) { if(n==1) return 1; return work(n-1)+n; } int n; int main() { cin>>n; cout<<work(n); return 0; }
大了个西瓜
2025年6月6日 11:50
求1到n的和 题解:
P1133
回复 0
|
赞 6
|
浏览 824
//求1到n的和 #include<stdio.h> int main(){ int n; scanf("%d",&n); int sum; if(n <= 100){ while(n) { ...
大了个西瓜
2025年6月6日 11:50
求1到n的和 题解:
P1133
回复 0
|
赞 1
|
浏览 680
//求1到n的和 #include<stdio.h> int main(){ int n; scanf("%d",&n); int sum; if(n <= 100){ while(n) { ...
大了个西瓜
2025年6月6日 11:49
求1到n的和 题解:
P1133
回复 0
|
赞 0
|
浏览 593
//求1到n的和 #include<stdio.h> int main(){ int n; scanf("%d",&n); int sum; if(n <= 100){ while(n) { ...
阿灿
2025年3月15日 03:00
求1到n的和 题解:
P1133
回复 0
|
赞 6
|
浏览 1.2k
#include<bits/stdc++.h> using namespace std; int main(){ int n,i,ans; cin>>n; cout<<(1+n)*n/2<<endl; return 0; }
18919717626
2024年6月29日 19:08
求1到n的和 题解:
P1133
回复 0
|
赞 3
|
浏览 1.4k
#include <iostream> using namespace std; typedef long long LL; int main(){ int n; LL ans = 0; cin >> n; for(int i = 1;i <= n;i ++){ ans += i; } cout << ans << endl; return 0; }
Candour
2024年4月21日 00:02
求1到n的和 (等差数列)题解:
P1133
回复 0
|
赞 3
|
浏览 1.2k
#include<bits/stdc++.h> using namespace std; typedef long long LL; int n; LL ans; int main() { cin >> n; ans = n * (1 + n) / 2; cout << ans; return 0; }
小酒
2024年3月11日 15:50
求1到n的和 题解:
P1133
回复 0
|
赞 2
|
浏览 1.4k
1133解题思路 #include <stdio.h> int main() { double n; scanf("%lf",&n); printf("%g",n*(n+1)/2); }
promising
2024年3月3日 20:43
求1到n的和 题解:
P1133
回复 0
|
赞 6
|
浏览 1.7k
#include<stdio.h> int main() { int n; scanf("%d",&n); int sum=0; for(int i=1;i<=n;i++) { sum=sum+i; } &nbs...
1
2
题目
求1到n的和
题解数量
19
发布题解
在线答疑
热门题解
1
求1到n的和 题解:
2
求1到n的和 题解:
3
求1到n的和 题解:
4
求1到n的和 题解:
5
求1到n的和 题解:
6
求1到n的和 (等差数列)题解:
7
求N到1的和题解
8
求1到n的和 题解:
9
for循环模拟题意
10
求1到n的和 题解: