From cd31f18c747ae25f15ebd4bc17bb014fe1159960 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EC=88=98=EB=AF=BC?= Date: Tue, 12 Nov 2024 00:19:32 +0900 Subject: [PATCH] CT_306 --- BOJ/Java/src/B4/Boj_8558_Slinia.java | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 BOJ/Java/src/B4/Boj_8558_Slinia.java diff --git a/BOJ/Java/src/B4/Boj_8558_Slinia.java b/BOJ/Java/src/B4/Boj_8558_Slinia.java new file mode 100644 index 0000000..51d54cb --- /dev/null +++ b/BOJ/Java/src/B4/Boj_8558_Slinia.java @@ -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(); + } +}