개요[ | ]
- HR자바 Java Loops II
Java
Copy
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 s = a;
for(int j=0; j<n; j++) {
s += Math.pow(2,j) * b;
System.out.format("%d ",s);
}
System.out.println();
}
in.close();
}
}
편집자 Jmnote Jmnote bot
로그인하시면 댓글을 쓸 수 있습니다.