while循环
课程:C++ · 编程练习
C++编程练习 - while循环
练习内容
#include <iostream>\nusing namespace std;\n\nint main() {\n int total = 0;\n int count = 1;\n\n while (count <= 10) {\n total += count;\n count++;\n }\n\n cout << "1到10的和是
课程:C++ · 编程练习
C++编程练习 - while循环
#include <iostream>\nusing namespace std;\n\nint main() {\n int total = 0;\n int count = 1;\n\n while (count <= 10) {\n total += count;\n count++;\n }\n\n cout << "1到10的和是