Advertisement
kk258966

4/1 物件導向程式設計 練習一

Apr 1st, 2015
269
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.57 KB | None | 0 0
  1. public class B10207081{
  2.    public static void main(String args[]){
  3.        
  4.      int a[][]={{33,32,56,45,33},{77,33,68,45,23},{43,55,43,67,65}};
  5.      int i,j,sum=0;
  6.      
  7.      for(i=0;i<a.length;i++){
  8.         System.out.print("業務員"+(i+1)+"的業績分別為 ");
  9.         for(j=0;j<a[i].length;j++){
  10.             System.out.print(a[i][j]+" ");
  11.             sum+=a[i][j];
  12.         }
  13.         System.out.println();
  14.      }      
  15.        
  16.     System.out.println("\n總銷售量為"+sum+"部車");
  17.     System.out.println("\n總銷員的銷售平均為"+((float)sum/a.length));
  18.    }
  19.        
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement