7 条题解

  • 0
    @ 2024-12-18 21:11:22
    #include <bits/stdc++.h>
     using namespace std; 
    int n;
    int main()
    {
    cin>>n;
    cout<<(1+n)*n/2;
    }
    
    • 0
      @ 2024-6-21 19:36:19

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

      | col1


      | col2 | col3 | | --- | --- | --- | | | | | | | | |

      • 0
        @ 2023-11-24 18:48:51

        还行

        • 0
          @ 2023-4-26 18:37:22

          #include<iostream> using namespace std; int n,ans; int main() { cin>>n; for(int i=1;i<=n;i++) { ans += i; } cout <<ans; return 0; }

          • 0
            @ 2022-12-15 20:07:04
            #include<iostream>
            using namespace std;
            int main(){
            	long long n;
            	cin>>n;
            	cout<<(1+n)*n/2;
            }
            

            一个字符都不想多打了

            • -1
              @ 2023-4-2 20:30:30
              #include<iostream>
              using namespace std;
              int main(){
              	long long n;
              	cin>>n;
              	cout<<(1+n)*n/2;
              }
              
              • -1
                @ 2022-4-25 21:58:56

                #include<iostream>

                using namespace std;

                int main(){

                int a;
                
                cin >> a;
                
                a = (1 + a) * a / 2;
                
                cout << a << endl;
                

                }

                • 1

                信息

                ID
                906
                时间
                1000ms
                内存
                128MiB
                难度
                4
                标签
                递交数
                529
                已通过
                225
                上传者