Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
2724 | A班-过懿萱 | 1加到多少才超过N | C++ | 通过 | 100 | 1 MS | 260 KB | 210 | 2024-12-21 10:57:23 |
#include <bits/stdc++.h> using namespace std; int main() { int n,temp = 0; cin>>n; for(int i = 1;i <= n;i++) { temp += i; if(temp > n) { cout<<i<<endl; break; } } return 0; }