Aidez moi s'il vous plait à corriger

samhar -  
 samhar -
Bonjour,

 public  void RécupérerPb()
 {   String chaine = null;
     
     ArrayList<String> info= new  ArrayList<String>();
     ArrayList<ArrayList> info2= new  ArrayList<ArrayList>();
     
    
         String[][]T1= new String[50][50];
         int[]TResource= new int[7];
         Fichier fic= new Fichier();
         String s;String[] data=null;
         Integer[][]T1OpRe;
       
      fic.ouvrirEnLecture("exp1.txt");
      int j=0,i=0;
           do{
          chaine=fic.lire();
          System.out.println(chaine);
        // récupérer dans un tab
          if(chaine!=null)
          data=chaine.split(" ");
          //s=chaine.trim();
          
        for (i=0;i<data.length;i++){
         
           
         T1[j][i]=data[i].toString();     
         
           
         }
           
       j++;
   }while(chaine!=null);
  System.out.println("fin/n");

  for (int k=1;k<j;k++)
  {
       System.out.println("*********************valeur**********************************"+k+"\n");
         for(int a=0;a<T1.length;a++)
         {// valeur des opérations pour chaque tache
           System.out.print("valeur "+a+"= "+T1[k][a]+"\t"); }
           // récupérer les resources des opérations pour chaque tache
           int b=1,h=0,f=0;
         while (T1[k][b]!=null)
         { 
              int nbreResource=Integer.parseInt(T1[k][b].toString());
              TResource[h]=nbreResource;
              ////////////////////
              int nbreOpp=Integer.parseInt(T1[k][0].toString());
              int nbreres=6;
             T1OpRe= new Integer[nbreOpp][nbreres]; 
         // remplissage de la matrice vide
         int l,m;
        for( l=1; l<nbreOpp; l++) {
        for( m=0; m<nbreres; m++) {
                T1OpRe[l][m]=0;
                  System.out.println( "T1OpRe[Op"+l+"][R"+m+"]"+T1OpRe[l][m]);
        }
        }
         for(f=b;f<b+(nbreResource*2);f++)
              {  
                  T1OpRe[k][Integer.parseInt(T1[k][f+1].toString())]=Integer.parseInt(T1[k][f+2].toString());
                 
              }
              
              h++;
              b=b+nbreResource*2;
              
              
        for( l=0; l<nbreOpp; l++) {
        for( m=0; m<nbreres; m++) {
              
                  System.out.println( "T1OpRe[Op"+l+"][R"+m+"]"+T1OpRe[l][m]);
        }
        }
         } 
           
        // for(int e=0;i<h;i++)
         //{System.out.print("
        // }
         }
         System.out.println("\n");
 
         
} 
        


mon fichier

6 2 1 5 3 4 3 5 3 3 5 2 1 2 3 4 6 2 3 6 5 2 6 1 1 1 3 1 3 6 6 3 6 4 3
5 1 2 6 1 3 1 1 1 2 2 2 6 4 6 3 6 5 2 6 1 1
5 1 2 6 2 3 4 6 2 3 6 5 2 6 1 1 3 3 4 2 6 6 6 2 1 1 5 5
5 3 6 5 2 6 1 1 1 2 6 1 3 1 3 5 3 3 5 2 1 2 3 4 6 2
6 3 5 3 3 5 2 1 3 6 5 2 6 1 1 1 2 6 2 1 5 3 4 2 2 6 4 6 3 3 4 2 6 6 6
6 2 3 4 6 2 1 1 2 3 3 4 2 6 6 6 1 2 6 3 6 5 2 6 1 1 2 1 3 4 2
5 1 6 1 2 1 3 4 2 3 3 4 2 6 6 6 3 2 6 5 1 1 6 1 3 1
5 2 3 4 6 2 3 3 4 2 6 6 6 3 6 5 2 6 1 1 1 2 6 2 2 6 4 6
6 1 6 1 2 1 1 5 5 3 6 6 3 6 4 3 1 1 2 3 3 4 2 6 6 6 2 2 6 4 6
6 2 3 4 6 2 3 3 4 2 6 6 6 3 5 3 3 5 2 1 1 6 1 2 2 6 4 6 2 1 3 4 2

1 réponse

Char Snipeur Messages postés 10112 Date d'inscription   Statut Contributeur Dernière intervention   1 299
 
quelle est ta question quel est ton problème ?
(désolé, ma boule de cristal n'a pas encore été réparée)
1
samhar
 
je veut corriger les exceptions de ce code,
0
samhar
 
et merci d'avance
0