import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); String a = scanner.nextLine(); char[] res; res = a.toCharArray(); for (int i = 0; i < a.length(); i++) { if (97
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); String a = scanner.nextLine(); System.out.println(a.length()); } }
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int a = scanner.nextInt(); for (int i = 1; i
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int a = scanner.nextInt(); for (int i = 1; i < 10 ; i++) { System.out.println(a + " * " + i + " = " + a*i); } } }
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int a = scanner.nextInt(); int b = scanner.nextInt(); int c = scanner.nextInt(); int d = scanner.nextInt(); int e = scanner.nextInt(); int res = (int) ((Math.pow(a,2)+Math.pow(b,2)+Math.pow(c,2)+Math.pow(d,2)+Math.pow(e,2))%10); System.out.println(res); } } Math.pow로 a..
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int a = scanner.nextInt(); for (int i = 0; i < a ; i++) { for (int j = 0; j
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); long a = scanner.nextLong(); long b = scanner.nextLong(); System.out.println(Math.abs(a-b)); } } 절대값을 계산해주는 함수 Math.abs() 함수를 이용하여 계산.