알고리즘

[알고리즘] 백준 30676 - 이 별은 무슨 색일까 (C++)

blueberrysoda 2024. 12. 13. 22:52

[문제 링크] : https://www.acmicpc.net/problem/30676

#include <iostream>
using namespace std;

int main(){
    int N;
    cin >> N;

    if(N <= 780 && N >= 620){
        cout << "Red\n";
    }
    else if(N < 620 && N >= 590){
        cout << "Orange\n";
    }
    else if(N <590 && N >= 570){
        cout << "Yellow\n";
    }
    else if(N < 570 && N >= 495){
        cout << "Green\n";
    }
    else if(N < 495 && N >= 450){
        cout << "Blue\n";
    }
    else if(N < 450 && N >= 425){
        cout << "Indigo\n";
    }
    else if(N < 425 && N >= 380){
        cout << "Violet\n";
    }
    return 0;
}