40分!
查看原帖
40分!
1113507
HEROBRINEH楼主2023/12/24 19:35
#include<bits/stdc++.h>
using namespace std;
int main(){
	int i=1,z=0,N,t=1;
	cin>>N;
	while(i<=N){
		int j=1;
		while(j<=t){
			z=z+t;
			i++;
			j++;
		}
		t++;
	}
	cout<<z;
	return 0;
}

求解

2023/12/24 19:35
加载中...