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
2014年9月17日 星期三
訂閱:
張貼留言 (Atom)
熱門文章
-
計算你的BMI
-
1. 利用遞迴input n算2^n 2. 用C算GCD(3333,456)
-
請用 C/C++/java寫一簡易程式
-
需要練習的Java程式:
-
BMI (Body Mass Index)= 體重 (kg) / 身高 ^2(m 2 ) 在台灣,行政院衛生署乃根據其相關研究,於2002年4月公佈台灣成人肥胖標準: BMI<18.5 為過輕, 18.5≦BMI<24 為正常體重, 24≦BMI<27 為過重, BM...
-
33, 45, 87, 99, 27 算平均
-
一、 試利用switch case由程式中直接輸入一個1~7 之間的整數day,代表星期一到星期日。若day 的值是1,則印出 "星期一",若day 的值是2,則印出 "星期二",若day 的值是7,則印出 "星期日",...
-
用 C/C++算上學期加權平均
29 則留言:
public class day917 {
public static void main(String[] args) {
int [] a={23,67,89,54};
int sum=0;
double av;
for(int i=0;i<a.length;i++){
sum+=a[i];
}
av=(double)sum/a.length;
System.out.println(av);
}
}
public class for1 {
public static void main(String[] args) {
int [] a={23,67,89,54};
int sum=0;
double av;
for (int i=0;i<x.length;i++)
sum+=x[i];
System.out.println();
}
}
public class oo1 {
public static void main(String[] args) {
int [] x={111,222,333,444,555};
int sum=0;
for(int i=0; i<x.length; i++)
sum+=x[i];
System.out.println(sum);
}
}
package hello1;
public class hello1 {
public static void main(String[] args) {
int [] x={32,49,50,68,93};
int sum=0;
for(int i=0; i<x.length; i++)
sum+=x[i];
System.out.println(sum);
}
}
public class DLAM {
public static void main(String[] args) {
int [] x={20,30,40,50,60};
int sum=0;
for(int i=0; i<x.length; i++)
sum+=x[i];
System.out.println(sum);
}
}
public class HHE1 {
public static void main(String[] args) {
int [] x={19,28,34,42,53};
int sum=0;
for(int i=0; i<x.length; i++)
sum+=x[i];
System.out.println(sum);
}
}
public class ex {
public static void main(String[] args) {
int []a={23,67,89,54};
int sum=0;
double av;
for(int i=0;i<=a.length ;i++);
sum+=a[i];
av=(double)sum/a.length;
System.out.println(av);
}
}
package hello;
public class ex {
public static void main(String[] args) {
int [] a={23,67,89,54};
int sum=0;
double av;
for(int i=0; i<=a.length;i++) {
sum += a[i];
av=(double)sum/a.length;
System.out.println(sum);
}
}
}
package b10033116_01;
public class Ex09 {
public static void main(String[] args) {
int[] a = { 23, 67, 89, 54 };
int sum = 0;
double av;
int i = 0;
// do {
for (i = 0; i < a.length; i++) {
sum += a[i++];
// } while (i <= a.length);
av = (double) sum / a.length;
System.out.println(av);
}
}
}
B10233178
package homework;
public class array {
public static void main(String args[]){
int [] a={23,67,89,54};
int sum=0;
for(int i=0;i<a.length;i++){
sum+=a[i];
}
System.out.println(sum);
}
}
package hello;
public class Java123 {
public static void main(String[] args) {
int [] a={23,67,89,54};
int sum=0;
double av;
for(int i=0; i<=a.length;i++) {
sum += a[i];
av=(double)sum/a.length;
System.out.println(sum);
}
}
}
public class for1 {
public static void main(String[] args) {
int [] a={23,67,89,54};
int sum=0;
for(int i=0; i<x.length; i++)
sum+=x[i];
System.out.println(sum);
}
}
public class ONE {
public static void main(String[] args) {
int [] a={23,67,89,54};
int sum=0;
double av;
for (int i=0;i<a.length;i++)sum+=a[i];
av=(double)sum/a.length;
System.out.println(av);
}
}
public class text1 {
public static void main(String[] args) {
int [] a={23,67,89,54};
int sum=0;
double av;
for(int i=0; i<a.length;i++){
sum+=a[i];
}
av=(double)sum/a.length;
System.out.println(av);
}
}
public class ex1 {
public static void main(String[] args) {
int [] a={23,67,89,54};
int sum=0;
double av;
for(int i=0; i<a.length;i++){
sum+=a[i];
}
av=(double)sum/a.length;
System.out.println(av);
}
}
public class TTT {
public static void main(String[] args) {
int [] a={23,67,89,54};
int sum=0;
double av;
for (int i=0;i<a.length;i++)sum+=a[i];
av=(double)sum/a.length;
System.out.println(av);
}
}
package hello;
public class ex {
public static void main(String[] args) {
int [] a={88,68,58,08};
int sum=0;
double av;
for(int i=0; i<=a.length;i++) {
sum += a[i];
av=(double)sum/a.length;
System.out.println(sum);
}
}
}
B10233069連于傑 提到...
public class for1 {
public static void main(String[] args) {
int [] a={10,20,30,40};
int sum=0;
double av;
for (int i=0;i<x.length;i++)
sum+=x[i];
System.out.println();
}
}
public class hello {
public static void main(String[] args) {
int [] x={20,30,40,50,60};
int sum=0;
for(int i=0; i<x.length; i++)
sum+=x[i];
System.out.println(sum);
}
}
public class hello {
public static void main(String[] args) {
int [] x={20,30,40,50,60};
int sum=0;
for(int i=0; i<x.length; i++)
sum+=x[i];
System.out.println(sum);
}
}
public class ex1 {
public static void main(String[] args) {
int [] x={20,30,40,50,60};
int sum=0;
for(int i=0; i<x.length; i++)
sum+=x[i];
System.out.println(sum);
}
}
public class ex2 {
public static void main(String[] args) {
int [] x={20,30,40,50,60};
int sum=0;
for(int i=0; i<x.length; i++)
sum+=x[i];
System.out.println(sum);
}
}
public class 165 {
public static void main(String[] args) {
int [] x={20,30,40,50,60};
int sum=0;
for(int i=0; i<x.length; i++)
sum+=x[i];
System.out.println(sum);
}
}
public class homework02 {
public static void main(String[] args) {
int [] a={23,67,89,54};
int sum=0;
double av;
for(int i=0;i<a.length;i++){
sum+=a[i];
}
av=(double)sum/a.length;
System.out.println(av);
}
}
public class ex2{
public static void main(String[] args) {
int [] x={2,30,40,50,60};
int sum=0;
for(int i=0; i<x.length; i++)
sum+=x[i];
System.out.println(sum);
}
}
package hello;
public class ex {
public static void main(String[] args) {
int [] a={40,59,78,87};
int sum=0;
double av;
for(int i=0; i<=a.length;i++) {
sum += a[i];
av=(double)sum/a.length;
System.out.println(sum);
}
}
}
public class z01 {
public static void main(String[] args) {
int [] x={10,20,30,40,50};
int sum=0;
for(int i=0; i<x.length; i++)
sum+=x[i];
System.out.println(sum);
}
}
public class day1009 {
public static void main(String[] args) {
int [] a={55,25,75,94};
int sum=0;
double av;
for(int i=0;i<a.length;i++){
sum+=a[i];
}
av=(double)sum/a.length;
System.out.println(av);
}
}
public class day917 {
public static void main(String[] args) {
int [] a={23,67,89,54};
int sum=0;
double av;
for(int i=0;i<a.length;i++){
sum+=a[i];
}
av=(double)sum/a.length;
System.out.println(av);
}
}
張貼留言