공부기록/SWEA

[SWEA] 2019번 더블더블

메델 2023. 10. 19. 14:06
public class Solution {
	
	public static void main(String[] args) {
		Scanner kb = new Scanner(System.in);
		int n = kb.nextInt();
		StringBuilder sb = new StringBuilder();
		int num=1;
		sb.append(num).append(" ");
		
		for(int i=0; i<n; i++) {
			num = num*2;
			sb.append(num).append(" ");
		}
		
		System.out.print(sb);
		
	}

}