We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int q = scanner.nextInt();
for (int i = 0; i < q; i++) {
int a = scanner.nextInt();
int b = scanner.nextInt();
int n = scanner.nextInt();
for (int j = 0; j < n; j++) {
a = (int) (a + (Math.pow(2, j) * b));
System.out.println(a);
}
}
scanner.close();
}
Java Loops II
You are viewing a single comment's thread. Return to all comments →
I don't know what I did wrong
import java.io.; import java.util.;
public class Solution {
}