ForNext
Only Do What Only You Can Do
123. define method
Hyperpolyglot C++ Style Languages: C++, Objective C, Java, C# より (2012.05.08)
VBScript
JScript
Perl
PHP
Python
Ruby
PowerShell
Scala
F#
C
C++
int Rational::height() { return (abs(num) > abs(denom)) ? abs(num) : abs(denom); }
C++Builder
VC++
C#
public int Height() { return (System.Math.Abs(this.num) > this.denom) ? System.Math.Abs(this.num) : this.denom; }
Java
public int height() { return (Math.abs(this.num) > this.denom) ? Math.abs(this.num) : this.denom; }
Objective-C
-(int) height { if ( abs(self.num) > abs(self.denom) ) { return abs(self.num); } return abs(self.denom); }