일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 31 |
- 스레드
- 마이크로 커널
- Swift
- 앱개발
- 멀티프로세스
- 스풀
- 폰노이만구조
- 프로세스
- IODevice
- 단일형 구조 커널
- kernel
- 부트캠프
- sdk
- 인터럽트
- 폰노이만
- bus
- 폴링
- closure
- 하버드구조
- API
- 운영체제
- 야곰아카데미
- Components
- 커널
- 계층형 구조 커널
- 버퍼
- 캐시
- 컴퓨터구조
- 코딩
- 멀티스레드
- Today
- Total
목록알고리즘 문제풀이/백준 (2)
생각, 고민, 문제해결의 기록
풀이 코드 import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int[] A = new int[N]; int X = sc.nextInt(); for (int i = 0; i < N; i++) { A[i] = sc.nextInt(); } for (int i = 0; i < A.length; i++) { if (A[i] < X) { System.out.print(A[i] + " "); } } } } 처음 풀이할 때 N개의 배열의 각 원소를 어떻게 입력해야 하는지 몰랐다. 사실 엄청 쉬운 건데 반복문 안..
내 코드 import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int star = sc.nextInt(); for (int i = 0; i < star; i++) { for (int j = 0; j < star; j++) { if (j < star - i - 1) { System.out.print(" "); } else { System.out.print("*"); } } System.out.println(); } } } 찾아보니 이정도 길이의 알고리즘은 상관없지만 더 복잡하고 긴 알고리즘을 짤 때는 Scanner를 사용하면 시간초과가 될 ..