int toto = chiffre.chiffre(10);
int toto = Chiffre.Traitement(10);
if (Srt>0 && Str<18) {NB 1;} else if (Srt>18 && Str<37) {NB 2;} else { //que faire dans ce cas???? } return NB;
{ public class chiffre { int Nb; chiffre(int Srt) { int[] R = new int[18] { 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18 } int[] N = new int[18] { 19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37 } for (int i = 0; i<=18 ; i++) { if (Srt == R[i]) { Nb=1 } } for (int i = 0; i<=18 ; i++) { if (Srt == N[i]) { Nb=2; } } // c est la que ca bloque : return Nb; } } }
namespace WindowsFormsApplication1 { public class chiffre { // erreur ici : que tout le code ne retourne pas de valeure a propos de "chiffre" public static int chiffre(int Srt) { int Nb; int[] R = new int[18] { 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18 }; int[] N = new int[18] { 19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37 }; for (int i = 0; i<=18 ; i++) { if (Srt == R[i]) { Nb=1; } } for (int i = 0; i<=18 ; i++) { if (Srt == N[i]) { Nb=2; } } } } }
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question