Skip to content

Commit

Permalink
Create Java Loops II.java
Browse files Browse the repository at this point in the history
  • Loading branch information
lado936 authored Nov 13, 2016
1 parent 219e3ed commit 27331a5
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions Java Loops II.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import java.util.*;
import java.io.*;

class Solution{
public static void main(String []argh){
Scanner in = new Scanner(System.in);
int t = in.nextInt();
for (int i = 0; i < t; i++) {
int a = in.nextInt();
int b = in.nextInt();
int n = in.nextInt();
int sum=a+b;
System.out.print(sum);
for(int l =1; l<n; l++){
sum=sum+(int)((Math.pow(2 , l))*b);
System.out.print(" " + sum);

}
System.out.println("");

}
in.close();}
}

0 comments on commit 27331a5

Please sign in to comment.