Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Test {
- public static void main(String args[]) {
- Scanner sc = new Scanner(System.in);
- System.out.println("Zahl eingeben: ");
- int x= sc.nextInt();
- int ergebnis=1;
- for(int i=0;i<x;i++){
- ergebnis*=2;
- System.out.printf("%5d\n",ergebnis);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement