2 条题解

  • 1
    @ 2025-12-2 19:03:55
    #include<bits/stdc++.h>
    using namespace std;
    int main(){
        int n,s=0;
        cin>>n;
        for(int i=1;i<=n;i++)
            s+=i;
        cout<<s;
        return 0;
    }
    
    • 0
      @ 2025-12-23 22:08:23
      #include <bits/stdc++.h>
      using namespace std;
      int main(){
      	int n;
      	cin >> n;
      	cout << (n + 1) * n / 2;
      	return 0;
      }
      
      • 1

      信息

      ID
      6929
      时间
      1000ms
      内存
      128MiB
      难度
      1
      标签
      递交数
      9
      已通过
      9
      上传者