-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path분산처리.java
More file actions
27 lines (21 loc) · 784 Bytes
/
분산처리.java
File metadata and controls
27 lines (21 loc) · 784 Bytes
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
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int n = Integer.parseInt(br.readLine());
for (int i = 0; i < n; i++) {
StringTokenizer st = new StringTokenizer(br.readLine());
int a = Integer.parseInt(st.nextToken());
int b = Integer.parseInt(st.nextToken());
int res = 1;
for (int j = 0; j < b; j++) {
res = (res * a) % 10;
}
if (res == 0) res = 10;
System.out.println(res);
}
}
}