到目前爲止,這是我的代碼,我也需要輸出從66下降到11,現在它高達11 66.如何讓我的Java輸出數遞減順序
public class ListNumbers {
public static void main(String[] args) {
//define limit
int limit = 66;
System.out.println("Printing Even numbers between 1 and " + limit);
for(int x=11; x <= limit; x++){
if(x != 44 && x != 22){
System.out.print(x + " ");
}
}
}
}
Δ你的for循環。 – ifly6
'for(int x = limit; x> = 11; x - )' –
'while(x - > 0)System.out.println(x);' – shmosel