본문 바로가기
  • Let's study
PS/Baekjoon

[백준] 30676: 이 별은 무슨 색일까(C++)

by 코딩고수이고파 2025. 8. 9.

문제

https://www.acmicpc.net/problem/30676

코드

#include <iostream>
using namespace std;

int main() {
	string color="";
	int nm;
	
	cin>>nm;
	
	if(nm>=620)
		color="Red";
	else if(nm>=590)
		color="Orange";
	else if(nm>=570)
		color="Yellow";
	else if(nm>=495)
		color="Green";
	else if(nm>=450)
		color="Blue";
	else if(nm>=425)
		color="Indigo";
	else
		color="Violet";
	
	cout<<color;
	
	return 0;
}

댓글