返回列表 發帖
  1. public class Ch01 {

  2.         public static void main(String[] args) {
  3.                 int total=0;
  4.                 for(int i=333;i<=999;i+=3)
  5.                         total+=i;
  6.                 System.out.println("333~999間所有3的倍數總和為: "+total);
  7.         }
  8. }
複製代碼

TOP

返回列表