时间复杂度O(1)
2025-05-25 21:07:01
发布于:江苏
1阅读
0回复
0点赞
#include <bits/stdc++.h>
using namespace std;
int n;
int main() {
cin >> n;
cout << (1 + n) * n / 2;
return 0;
}
这里空空如也
2025-05-25 21:07:01
发布于:江苏
#include <bits/stdc++.h>
using namespace std;
int n;
int main() {
cin >> n;
cout << (1 + n) * n / 2;
return 0;
}
这里空空如也
提交答案之后,这里将显示提交结果~
有帮助,赞一个