Advertisement
AnoTest

Foot

Dec 8th, 2021
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.49 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class test {
  4.  
  5.     public int [][] Tableau = new int[6][6];
  6.     public void remplirTableau(){
  7.         var testIndex =0;
  8.         Scanner sc = new Scanner(System.in);
  9.         var test = new String[]{"Gagné", "Nul","Perdu","Marqués","Encaissés","O"};
  10.         for(var i=0; i<Tableau.length;i++){
  11.             System.out.println("\n");
  12.             for (var j=0; j<Tableau.length;j++){
  13.                 System.out.print(String.format("Equipe n° [%d]\n",i));
  14.                 System.out.println(test[j]);
  15.                 Tableau[i][j] = sc.nextInt();
  16. //                System.out.print(Tableau[i][j] +" ");
  17.             }
  18.         }
  19.  
  20.     }
  21.  
  22.     public void afficheTableau(){
  23.         for(var i=0; i<Tableau.length;i++){
  24.             System.out.println("\n ---------------------");
  25.             for (var j=0; j<Tableau.length;j++){
  26.                 System.out.print(Tableau[i][j] +" ");
  27.             }
  28.         }
  29.     }
  30.  
  31.     public void mettreAJourTableau(){
  32.         for(var i=0; i<Tableau.length;i++){
  33.             System.out.println("\n ---------------------");
  34. //            Tableau[i][5] = Tableau[i][0] * 3;
  35. //            Tableau[i][1] = Tableau[i][1] *1;
  36.             int resultat = (Tableau[i][0]*3) + (Tableau[i][1]*1);
  37.             Tableau[i][5] = resultat;
  38.         }
  39.     }
  40.     public static void main(String[] args) {
  41.     test test = new test();
  42.         test.remplirTableau();
  43.         test.mettreAJourTableau();
  44.         test.afficheTableau();
  45.  
  46.     }
  47. }
  48.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement