Afficher un message
Vieux 15/10/2007, 18h01   #1
Juha Nieminen
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: comparison logic!!

curiousEngine wrote:
> if (A > B){
> if (A > C)
> max = A;
> } else {
> if (B > C)
> max = B;
> else if (C > A)
> max = C;
> }


If you want to do your homework in a bit more obfuscated way, you can
do that with a one-liner:

max = A > B ? A > C ? A : C : B > C ? B : C;
  Réponse avec citation
 
Page generated in 0,04318 seconds with 9 queries