如何使用来自不同 while 循环的变量并将它们插入到打印语句中?
public class Squares{
public static void main (String [] args){
int counterA = 0;
int counterB= 0;
while (counterA<51){
counterA++;
if (counterA % 5 == 0){
int one = (counterA*counterA);
}
}
while (counterB<101){
counterB++;
if (counterB % 2 == 0){
int two = (counterB*counterB);
}
}
System.out.println(one+two);
}
}