Advertisement
Guest User

Untitled

a guest
Jul 21st, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.56 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. /**
  4. *
  5. * @author paiman
  6. */
  7.  
  8. class ClassementofFootballLeague {
  9.  
  10.  
  11.  
  12. public static void main(String args[]) throws Exception{
  13.  
  14.  
  15.  
  16. int[] wp=new int[3];
  17.  
  18.  
  19.  
  20. int[] dp=new int[1];
  21.  
  22.  
  23.  
  24. int[] lp=new int[0];
  25.  
  26.  
  27.  
  28. Scanner input = new Scanner(System.in);
  29.  
  30.  
  31.  
  32. System.out.print("How many teams are in the Classement? ");
  33.  
  34.  
  35.  
  36. int sum=input.nextInt();
  37.  
  38.  
  39.  
  40. String t[]=new String[sum];
  41.  
  42.  
  43.  
  44. int[] w=new int[sum];
  45.  
  46.  
  47.  
  48. int[] d=new int[sum];
  49.  
  50.  
  51.  
  52. int[] l=new int[sum];
  53.  
  54.  
  55.  
  56. int[] pts = new int[sum];
  57.  
  58.  
  59.  
  60.  
  61. for(int i=0;i<t.length;i++){
  62.  
  63.  
  64.  
  65. System.out.print("\nTeam "+(i+1)+": ");
  66.  
  67.  
  68.  
  69. t[i]=input.next();
  70.  
  71.  
  72.  
  73. System.out.print("Win : ");
  74.  
  75.  
  76.  
  77. w[i]=input.nextInt();
  78.  
  79.  
  80.  
  81. System.out.print("Draw : ");
  82.  
  83.  
  84.  
  85. d[i]=input.nextInt();
  86.  
  87.  
  88.  
  89. System.out.print("Lose : ");
  90.  
  91.  
  92.  
  93. l[i]=input.nextInt();
  94.  
  95.  
  96.  
  97.  
  98. pts[i]=wp.length*w[i]+dp.length*d[i];
  99.  
  100.  
  101.  
  102.  
  103. }
  104. // Arrays.sort(pts);
  105. // Array.sort(pts, Collections.reverseOrder());
  106. // if(){
  107. //
  108. // }
  109.  
  110.  
  111.  
  112. System.out.println("\n==================================================");
  113.  
  114.  
  115.  
  116. System.out.println("\tFootball League Classement");
  117.  
  118.  
  119.  
  120. System.out.println("==================================================");
  121.  
  122.  
  123.  
  124. System.out.print("| Team\tW\tD\tL\tPts\t |\n");
  125.  
  126.  
  127.  
  128. System.out.print("--------------------------------------------------\n");
  129.  
  130.  
  131.  
  132.  
  133. for(int j=0;j<t.length;j++){
  134.  
  135.  
  136.  
  137. System.out.print("| "+t[j]+"\t"+"| "+w[j]+"\t"+"| "+d[j]+"\t"+"| "+l[j]+"\t"+pts[j]+" |\n");
  138.  
  139.  
  140.  
  141. }
  142.  
  143.  
  144.  
  145.  
  146. System.out.println("==================================================");
  147.  
  148.  
  149.  
  150.  
  151. }
  152. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement