Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
137504 胡海峰老师 累加器 C++ Accepted 1 MS 268 KB 546 2025-11-18 15:40:48

Tests(1/1):


Code:

#include <iostream> //designed by hu 2025-10 using namespace std; int main(){ int a=0,i=100; while (i>=1){ a += i; // a += i a = a + i i--; // i++ ++i ---> i = i + 1 memory is an essential for learning } cout << a; //cout << endl << i; //当循环结束时,i的值肯定会让 i<=100不成立?? 101 // int a = 0; // result 结果 // for(int i=100;i>=1;i--){ // a = a + i; // } // cout<< a; //拐杖扔掉 return 0; }