class Esercizio {
public static boolean M(int i){
boolean b = false;
if (i == 0) return b;
else return !M(i-1);
}
public static void main(String [] args){
System.out.println(M(3));
}
}
Che sigificato ha il ! prima della chiamata ricorsiva?
class Esercizio {
public static boolean M(int i){
boolean b = false;
if (i == 0) return b;
else return !M(i-1);
}
public static void main(String [] args){
System.out.println(M(3));
}
}
Che sigificato ha il ! prima della chiamata ricorsiva?
[ SimplyMepis 8 ]Copyleft
www.mepisitalia.org IL SITO ITALIANO UFFICIALE DI MEPIS
www.salentomovida.it LA MOVIDA DEL SALENTO HA UN NUOVO PUNTO D'INCONTRO SUL WEB
[ SUD SOUND SYSTEM MINA FUECU INTRA ALLU SALENTU ]
Significa che il valore restituito sara' la negazione del risultato della chiamata alla funzione M(i-1)
Di quale linguaggio parliamo? E' obbligatorio indicarlo nel titolo, come da Regolamento.
MARCO BREVEGLIERI
Software and Web Developer, Teacher and Consultant
Home | Blog | Delphi Podcast | Twitch | Altro...