java實現累加求和,計算從1加到100的結果

用三種循環方式實現,for、while、dowhileweb 1、for循環 package com.loop.test; /** * 累加求和,計算1+2+3+...+100=? * 用for實現 */ public class AddSumFor { public static void main(String[] args) { int sum=0;
相關文章
相關標籤/搜索