Algorithm/SW Expert Academy
2019. 더블더블
히욤이
2019. 1. 10. 22:53
* 문제의 저작권은 SW Expert에 있습니다
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | import java.util.Scanner; class Solution { public static void main(String args[]) { Scanner scanner = new Scanner(System.in); int input = scanner.nextInt(); //받은 수 int temp = 1 ; for (int i = 1; i <= input+1; i++) { System.out.print(temp +" "); temp = temp * 2; } } } | cs |