본문 바로가기
알고리즘 문제풀이/백준

[백준] 2914 저작권 - 자바

by jeonghaemin 2021. 9. 16.
728x90

문제

https://www.acmicpc.net/problem/2914

풀이 코드

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());
        int a = Integer.parseInt(st.nextToken());
        int i = Integer.parseInt(st.nextToken());

        System.out.println(a * (i-1) + 1);
    }
}

댓글