1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <iostream>
int main() {
    int input;
    while (1) {
        std::cout << "입력: ";
        std::cin >> input;
        if (input == 0)
            std::cout << "입력값은 0" << std::endl;
        else if (input > 0)
            std::cout << "입력값은 양수" << std::endl;
        else if (input < 0)
            std::cout << "입력값은 음수" << std::endl;
    }
}
cs

+ Recent posts