Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
2754 | A班-何泓霏 | 1加到多少才超过N | C++ | 编译错误 | 0 | 0 MS | 0 KB | 234 | 2024-12-21 11:54:33 |
#include<bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; int temp=0; for(int i=1;temp<n;i++) { if(temp>n) { cout<<i-1;break; } else { temp+=i; } } cout<<i<<endl; return 0; }