#15:複数のデータを受け取る
ここでは、ループ処理で、複数のデータを受け取る方法を学習します。ループ処理のなかで cin を使うと、標準入力から 1 行ずつ複数のデータを受け取ることができます。
#include <iostream>
using namespace std;
int main() {
int count;
cin >> count;
string name;
for (int i = 0; i < count; i++) {
cin >> name;
cout << "Hello " << name << endl;
}
}