Run ID:149638
提交时间:2026-03-15 13:53:16
#include <iostream> #include <stack> using namespace std; stack<char> st; int main() { /* for (循环变量初始化;循环条件;循环变量的改变) { // 满足循环条件才会执行 if(){ continue;//跳过当前这一次循环 //... } //..... } 循环变量初始化; while (循环条件) { // 满足循环条件才会执行 while(){ if(){ break;//终止最近的整个循环 } } 循环变量的改变; } */ int i = 1; int s = 0; while (true) { s += i; if (s > 1000) { cout<<i; break; // cout<<s; } i++; } }