球球康康哪错了
查看原帖
球球康康哪错了
945742
hexuchen楼主2023/5/8 17:31

C++ 只有40分 QWQ


#include <bits/stdc++.h>
using namespace std;
int main() {
    int k;
    long long sum=0,day=0,base=1;
    cin>>k;
    while(day<k){
    	day+=base;
    	sum+=base*base;
    	base++;
	}
	cout<<sum;
    return 0;
}

错在哪 QWQ

2023/5/8 17:31
加载中...