Un pb dans l'excution d'un prog

Fermé
Katiya92 Messages postés 1 Date d'inscription mercredi 8 avril 2015 Statut Membre Dernière intervention 9 avril 2015 - 9 avril 2015 à 22:15
voila mon prog svp aidez moi a trouver le pb Merci d'avance
public static void main(String[] args) {
// TODO code application logic here
int n=9;
int p[]={9,4,4,4,4,3, 2 ,2 ,2};
int nb;
int c=12;
int [] []x=new int [n+1][n+1];
int i=1, j;

int cap []={12,12,12,12,12,12,12,12};

while (i<=n){
j=1;
while (j<=n){

if (p[i]<= cap[j]);{
x[i][j]=1;
cap[j]=cap[j]-p[i];

}

j++;
break;
}
i++;
}

nb=0;j=0;
while(j<=n){
if(cap[j]!=12){
nb=nb+1;
}
}
System.out.println("le nbr de boite est:" + nb );

}

}
A voir également: