개수
반응형
Count Algorithm - 개수 알고리즘
Count Algorithm - 개수 알고리즘 n개의 정수 중 조건에 맞는 정수의 개수를 구하는 알고리즘 package countAlgorithm; //[?] n개의 정수 중 13의 배수의 개수 (건수, 횟수) /* * 개수 알고리즘(Count Algorithm): 주어진 범위에 주어진 조건에 해당하는 자료들의 개수 */ public class CountAlgorithm { public static void main(String[] args) { //[1] Input int[] numbers = {13,23,46,43,26,76,56,39,52}; int count = 0; //[2] Process for(int i = 0; i < numbers.length; i++) if (numbers[i] % 13..
반응형