While Loops
2025年3月21日...小于 1 分钟
While Loops
0x00 Syntax
while (condition) {
do_sth();
}
or
do {
do_sth();
} while (condition)
Case Study
Loops to output integers 1 - 5.
#include <iostream>
using namespace std;
int main() {
int i = 1;
while (i <= 5) {
cout << i << endl;
i++;
}
return 0;
}
你认为这篇文章怎么样?
- 0
- 0
- 0
- 0
- 0
- 0
Powered by Waline v3.5.6