백준 #28074번 모비스

jhj·2024년 2월 17일

백준 JAVA

목록 보기
355/583
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		
		String a = sc.next();
		int M = 0;
		int O = 0;
		int B = 0;
		int I = 0;
		int S = 0;
		
		for(int i = 0; i < a.length(); i++) {
			if(a.charAt(i) == 'M') {
				M = 1;
			}else if(a.charAt(i) == 'O') {
				O = 1;
			}else if(a.charAt(i) == 'B') {
				B = 1;
			}else if(a.charAt(i) == 'I') {
				I = 1;
			}else if(a.charAt(i) == 'S') {
				S = 1;
			}
		}
		
		if(M == 1 && O == 1 && B == 1 && I == 1 && S == 1) {
			System.out.println("YES");
		}else {
			System.out.println("NO");
		}
		sc.close();
	}
}
profile
개발자를 꿈꾸는

0개의 댓글