全错救救,样例都对了,
查看原帖
全错救救,样例都对了,
1181556
Terrabro楼主2023/11/3 23:36
#include <bits/stdc++.h>

using namespace std;

int main(){
    int a,temp1=1,temp2=1,result;
    cin >> a;
    for(int i=1;i<=a;i++){
        result+=temp1;
        temp2++;
        if(temp2>temp1){
            temp2=1;
            temp1++;
        }
    }
    cout << result;
    return 0;
}
2023/11/3 23:36
加载中...