全部评论 2

  • #include<bits/stdc++.h>
    using namespace std;
    int main(){
    int n=1,k,ans=0;
    cin>>k;
    while(k>0){
    for(int i=1;i<=n;i++){
    if(k==0){
    break;
    }
    k--;
    ans+=n;
    }
    n++;
    }
    cout<<ans;

    return 0;
    }

    2024-06-04 来自 浙江

    0
  • 哪来的K,没定义

    2024-02-05 来自 内蒙古

    0
首页