public class for1 {
public static void main(String[] args) {
int [] a={23,67,89,54};
int sum=0;
double av;
int i=0;
do{
sum+=a[i++];
}
while( i<=a.length) ;
av=(double)sum/a.length;
System.out.println(av);
}
}
herrDeng網內搜尋
自訂搜尋
Ads
訂閱:
意見 (Atom)
熱門文章
-
計算你上學期加權平均
-
產生50個元素的陣列並排序
-
Caesar挪移碼密文: MCLGZ 請破譯!
-
請用 C/C++/java寫一簡易程式
-
計算你的BMI
-
利用static方法輸出BMI
-
借錢500萬,年利18%,每月複利計算,請問連本帶利的金額 5, 10, 15, 20, 25, 30, 35, 40, 45, 50年的金額。並比較公式: A*exp(0.18n) A*(1+0.18/12)^(12*n), n=年數, A=本金 hint: math.h, p...
-
算上學期加權平均
-
array ex 1, 2,3,7,8
