Notice
Recent Posts
Recent Comments
Link
- Today
- Total
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- coroutine
- n3문법
- rxjava
- 진짜학습지
- PR
- 안드로이드
- github
- 학습지
- posting
- blog
- pullrequest
- 코틀린
- 진짜학습지후기
- KotlinInAction
- ai
- Android
- Kotlin
- webflux
- errorhandling
- 일본어기초
- 책리뷰
- 일본어문법
- suspend
- 인공지능
- GIT
- androidstudio
- jlpt
- 책추천
- CustomTab
- 진짜일본어
Archives
코딩하는 개굴이
BaekJoon/BOJ [JAVA] X보다 작은 수_10871 본문
반응형
BaekJoon/BOJ [JAVA] X보다 작은 수_10871
HINT: 입력받으면서 구분해 arraylist에 넣어 주었다!
import java.util.ArrayList;
import java.util.Scanner;
public class baekjoon_10871 {
public static void main(String[] argc){
Scanner scanner = new Scanner(System.in);
int iter = Integer.parseInt(scanner.next());
int num = Integer.parseInt(scanner.next());
ArrayList<Integer> arrayList = new ArrayList<>();
for(int i=0;i<iter;i++) {
int tmp = Integer.parseInt(scanner.next());
if(tmp<num) arrayList.add(tmp);
}
for(int i=0;i<arrayList.size();i++)
System.out.print(arrayList.get(i)+" ");
System.out.println();
scanner.close();
}
}
반응형
'알고리즘 > Baekjoon' 카테고리의 다른 글
BaekJoon/BOJ [JAVA] 시험 성적_9498 (0) | 2018.11.25 |
---|---|
BaekJoon/BOJ [JAVA] 평균_1546 (0) | 2018.11.25 |
BaekJoon/BOJ [JAVA] 세 수_10817 (0) | 2018.11.25 |
BaekJoon/BOJ [JAVA] 시험 성적_9498 (0) | 2018.11.25 |
BaekJoon/BOJ [JAVA] 숫자카드_10815 (0) | 2018.11.16 |
Comments