高斯求和
2024-11-11 21:53:01
发布于:云南
4阅读
0回复
0点赞
#include<bits/stdc++.h>
using namespace std;
int main(){
int T; cin >> T;
while(T--){
long long n; cin >> n;
cout << n * (n + 1) / 2 << endl;
}
return 0;
}
这里空空如也
2024-11-11 21:53:01
发布于:云南
#include<bits/stdc++.h>
using namespace std;
int main(){
int T; cin >> T;
while(T--){
long long n; cin >> n;
cout << n * (n + 1) / 2 << endl;
}
return 0;
}
这里空空如也
提交答案之后,这里将显示提交结果~
有帮助,赞一个