Hard deck/Deep dive

for / if / while : 각 공간의 사용 구분

서버관리자 페페 2022. 8. 2. 22:54
// Operating Counter(2/2)
int count = 0;
for (int i = 2; i < A.length; i++) {
    if (A[i] != 0) {
        long temp = A[i];
        while ((double)A[i] <= (double)Max/(double)temp) {
            if ((double)A[i] >= (double)Min/(double)temp) {
                count++;
            }
            temp = temp*A[i];
        }
    }
}

for는 시행공간 및 시행을 projecting

while은 그 중에서 특정 범위를 추려서 반복

if 는 주로 행동양식을 규정함