2720๋ฒ: ์ธํ์ ์ฌ์ฅ ๋ํ (acmicpc.net)
1. ๋ด ์ฝ๋
import java.util.Arrays;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
for (int test_case = 0; test_case < N; test_case++) {
int change = sc.nextInt();
int[] cent = new int[]{25,10,5,1};
int[] result = new int[4];
for (int i = 0; i < 4; i++) {
result[i] = change/cent[i];
change -= cent[i]*(change/cent[i]);
}
Arrays.stream(result).forEach(x-> System.out.printf("%d ",x));
System.out.println();
}
}
}
0