/*
1. 4개의 정수 변수 선언
2. 정수 4개 입력받음
3. if문으로 앞의 정수보다 큰지 작은지 판별하여 각각 UP, DOWN 출력
4. 입력된 정수가 모두 같은 경우에는 NONE을 출력
**맨 마지막에 NONE이 왜 if가 아니고 else문인지 생각해 보기!!!
*/

#include <stdio.h>

int main() {
    int n1, n2, n3, n4;
    scanf("%d%d%d%d", &n1, &n2, &n3, &n4);

    if (n1 > n2) {
        printf("DOWN ");
    }
    else if (n1 < n2) {
        printf("UP ");
    }
    if (n2 > n3) {
        printf("DOWN ");
    }
    else if (n2 < n3) {
        printf("UP ");
    }
    if (n3 > n4) {
        printf("DOWN");
    }
    else if (n3 < n4) {
        printf("UP");
    }
    else {
        printf("NONE");
    }
    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: