import java.math.BigInteger; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int T = sc.nextInt(); while (T-- != 0) { int a = sc.nextInt(); int b = sc.nextInt(); int c = sc.nextInt(); for(int i = 0 ; i < c ; i ++) { double num = Math.pow(2,i) * b + num; System.out.println(num + a); } } } }帮我改正这个java代码
时间: 2023-03-08 20:10:13 浏览: 96
Java中BigInteger.docx
很高兴能帮上忙!改正过的代码如下:import java.math.BigInteger;
import java.util.Scanner;public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int T = sc.nextInt();
while (T-- != 0) {
int a = sc.nextInt();
int b = sc.nextInt();
int c = sc.nextInt();
for(int i = 0 ; i < c ; i++) {
double num = Math.pow(2,i) * b;
System.out.println(num + a);
}
}
}
}
阅读全文