전체 글 (1) 썸네일형 리스트형 사과 package backjoon; import java.util.Scanner; public class Apple { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int schoolCount = scanner.nextInt(); int result = 0; for (int i = 0; i < schoolCount; i++) { int studentsCount = scanner.nextInt(); int appleCount = scanner.nextInt(); result += appleCount % studentsCount; } System.out.println(result); } } 이전 1 다음