본문 바로가기
(문제풀이)

프로그래머스(java) : 세균 증식

by cogito-new 2022. 10. 10.

class Solution {
    public int solution(int n, int t) {
        int answer = 0;
        int number = n;
        for(int i = 1; i<=t; i++) {
            number *= 2;
        }
        answer =  number;
        return answer;
    }
}

 

반응형