#14:処理の繰り返し回数を指定する
ここでは、ループ処理の繰り返し回数を、プログラムの実行時に受け取る方法を学習します。ループ処理では、変数で繰り返し回数を指定できます。
#include <iostream>
using namespace std;
int main() {
int count;
cin >> count;
cout << count << endl;
string greeting = "Hello world";
for (int i = 0; i < count; i++) {
cout << greeting << endl;
}
}