C++
C++ - cin의 입력이 없을 시 종료
마루설아
2025. 1. 19. 15:47
while (true) {
cin >> num;
if (cin.eof()) return 0;
...
}
// or
while (cin >> num) {
...
}