-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathc1025.java
More file actions
31 lines (26 loc) ยท 1.15 KB
/
Copy pathc1025.java
File metadata and controls
31 lines (26 loc) ยท 1.15 KB
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
import java.util.Scanner;
public class c1025 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.print("๋ค์ฏ์๋ฆฌ ์ ์ ์
๋ ฅ: ");
int num = sc.nextInt();
sc.close();
int first = (num / 10000) * 10000;
int second = (num - first) / 1000 * 1000;
int third = (num - first - second) / 100 * 100;
int fourth = (num - first - second - third) / 10 * 10;
int fifth = (num - first - second - third - fourth);
System.out.println("[" + first + "]");
System.out.println("[" + second + "]");
System.out.println("[" + third + "]");
System.out.println("[" + fourth + "]");
System.out.println("[" + fifth + "]");
}
}// end c1025
// ์
๋ ฅ ํด๋์ค์ธ Scanner ๊ฐ์ฒด ์์ฑ
// ๋จ์ด ์
๋ ฅ๋ฐ์
// ์
๋ ฅ ์ข
๋ฃ๋์์ผ๋ฏ๋ก sc ๊ฐ์ฒด ๋ซ๊ธฐ
// ์
๋ ฅ ๋จ์ด์ ๊ธธ์ด์ ๋ง์ถฐ ๋ฌธ์๋ฐฐ์ด ์์ฑ (Boy ๊ธธ์ด๋ '3', ๋ฌธ์๋ฐฐ์ด๋ 3์นธ ์์ฑ)
// for๋ฌธ์ ํตํด ๋ฌธ์์ด์ ๋ฌธ์ ํ๋์ฉ์ ๋ฌธ์๋ฐฐ์ด์ ์ ์ฅ
// - i๊ฐ 0, 'B'๋ฅผ arr[0]์ ์ ์ฅ..
// EnhancedLoop๋ฅผ ์ด์ฉํ์ฌ arr์ ๊ฐ๋ค์ ์ถ๋ ฅ