哈基米 • 16天前
using namespace std;
int main() {
int k;
cin >> k;
int a = 0;
int n = 1;
int days = 1;
while (days <= k) {
for (int i = 1; i <= n; i++) {
a = a + n;
days++;
if (days > k) {
break;
}
}
n++;
}
cout << a;
return 0;
}
评论:
请先登录,才能进行评论