-
[브론즈 Ⅴ] 26209번 :: Intercepting Information / Java백준/브론즈 2023. 2. 23. 19:38
문제
https://www.acmicpc.net/problem/26209
26209번: Intercepting Information
The input consists of a single line, containing $8$ integers $N_1$, $N_2$, $N_3$, $N_4$, $N_5$, $N_6$, $N_7$ and $N_8$, indicating the values read by the device ($N_i$ is 0, 1 or 9 for $1 ≤ i ≤ 8$).
www.acmicpc.net
코드
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(br.readLine());; boolean b = true; for(int i=0; i<8; i++) { int N = Integer.parseInt(st.nextToken()); if(N != 0 && N != 1) { b = false; break; } } System.out.println(b==true ? "S" : "F"); } }
'백준 > 브론즈' 카테고리의 다른 글
[브론즈 Ⅴ] 27294번 :: 몇개고? / Java (0) 2023.02.24 [브론즈 Ⅴ] 26575번 :: Pups / Java (0) 2023.02.23 [브론즈 Ⅴ] 26082번 :: WARBOY / Java (0) 2023.02.23 [브론즈 Ⅴ] 25372번 :: 성택이의 은밀한 비밀번호 / Java (0) 2023.02.23 [브론즈 Ⅴ] 25304번 :: 영수증 / Java (0) 2023.02.23