不太懂为什么?
import java.util.Scanner;
public class B1022 {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int A = in.nextInt();
int B = in.nextInt();
int P = in.nextInt();
int C = A + B;
int []numD = new int[100];
while(C != 0)
{
for (int i = 0; i < 100; i++)
{
numD[i++] = C % P;
C = C / P;
}
}
/*如何把未知长度的数组倒着输出*/
for (int x = i - 1; x >= 0; x--) /*error: i cannot be a variable*/
{
System.out.print(numD[x]);
}
in.close();
}
}