Skip to content

Commit

Permalink
CT_306
Browse files Browse the repository at this point in the history
  • Loading branch information
Jade-Good committed Nov 11, 2024
1 parent 6ab65e5 commit cd31f18
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions BOJ/Java/src/B4/Boj_8558_Slinia.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package B4;

import java.io.*;

public class Boj_8558_Slinia {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));

int n = Integer.parseInt(br.readLine());
int result = 1;

for (int i = 2; i <= n; i++) {
result = result * i % 10;
}

bw.write(Integer.toString(result));
bw.flush();
}
}

0 comments on commit cd31f18

Please sign in to comment.