Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
116973 令狐文丽 15加到第几项 C++ Accepted 0 MS 256 KB 362 2025-04-13 09:22:25

Tests(1/1):


Code:

#include<iostream> using namespace std; int main(){ /** for(int i = 1;i<= 100;i++){ if(i == 50){ break;//结束 之后所有都结束 //continue;//只结束满足条件 } cout<<i; } **/ // 1 - n s = 1+ 2+3 +..+n 刚好s>1000 时 求n int s = 0; int n=0; while(s<= 1000){ n++; s +=n; } cout<<n; return 0; }