본문 바로가기

Programming/Tip&Informaion

[C++] 무한 입력받기

#include <iostream>
using namespace std;

int main(){
    while(!cin.eof()){
        string n;
        getline(cin,n);
        cout << n << endl;
    }
}


while(!cin.eof())