文章

4

粉丝

11

获赞

1

访问

3.8k

头像
求1到n的和 题解:
P1133 北京大学机试题
发布于2023年7月27日 14:09
阅读数 411

#include<bits/stdc++.h>
using namespace std;
int n, res;
int main()
{	cin >> n;
	for ( int i = 1; i <= n; i ++)
		res += i;
	cout << res ;
	return 0;
}

 

登录查看完整内容


登录后发布评论

暂无评论,来抢沙发