在开头插入要挪几次
运行下面这段程序,它数的是「挪了几次」:
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main() {
int n = 5, moves = 0;
for (int j = n; j > 0; j--) moves++;
cout << moves << endl;
}
(本题用 g++ -std=c++17 -O0 编译。)
运行下面这段程序,它数的是「挪了几次」:
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main() {
int n = 5, moves = 0;
for (int j = n; j > 0; j--) moves++;
cout << moves << endl;
}
(本题用 g++ -std=c++17 -O0 编译。)
全部评论