https://www.acmicpc.net/problem/10178
10178번: 할로윈의 사탕
할로윈데이에 한신이네는 아부지가 사탕을 나눠주신다. 하지만 한신이의 형제들은 서로 사이가 좋지않아 서른이 넘어서도 사탕을 공정하게 나누어 주지 않으면 서로 싸움이 난다. 매년 할로윈
www.acmicpc.net
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int T = Integer.parseInt(br.readLine());
for (int i = 0; i < T; i++) {
StringTokenizer st = new StringTokenizer(br.readLine());
int c = Integer.parseInt(st.nextToken());
int v = Integer.parseInt(st.nextToken());
System.out.println("You get " + (c/v) + " piece(s) and your dad gets " + (c%v) + " piece(s).");
}
}
}
'알고리즘 > 백준' 카테고리의 다른 글
백준 5988 홀수일까 짝수일까 (0) | 2022.12.07 |
---|---|
백준 4458 첫 글자를 대문자로 (0) | 2022.12.07 |
백준 11966 2의 제곱인가 (0) | 2022.12.07 |
백준 11023 더하기 3 (0) | 2022.12.07 |
백준 3059 등장하지 않는 문자의 합 (0) | 2022.12.07 |