Java Loops II

  • + 0 comments

    public static void main(String[] args) throws IOException { int[][] mint=new int[100][3];

        Scanner scanner1 =new Scanner(System.in);
        int q =scanner1.nextInt();
    
    
        for (int i=0; i<q;i++){
    
            mint[i][0]=scanner1.nextInt();
            mint[i][1]=scanner1.nextInt();
            mint[i][2]=scanner1.nextInt();
    
        }
        scanner1.close();
    
    
        for (int i=0; i<q;i++){
            int sonuc=mint[i][0];
            int us=1;
            for (int j=0; j<mint[i][2];j++){
                int b= us*mint[i][1];
                sonuc=(sonuc+b);
                System.out.print(sonuc+" ");
                us*=2;
            }
            System.out.println();
        }
    }