[java][swea][d1] 2019. 더블더블
728x90

2019. 더블더블

 

SW Expert Academy

SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요!

swexpertacademy.com

import java.util.Scanner;
import java.io.FileInputStream;

class d1_2019
{
	public static void main(String args[]) throws Exception
	{
		
		System.setIn(new FileInputStream("res/input.txt"));

		
		Scanner sc = new Scanner(System.in);
		int T=sc.nextInt();
		int a = 1;
		System.out.print(a+" "); // 1부터 출력
		
		for(int test_case = 1; test_case <= T; test_case++)
		{
			a *= 2; // 2씩 T번 곱하면서 출력
			System.out.print(a+" ");
		}
	}
}
728x90