//overrided ToString()
 public override string ToString()
 {
     if (Denominator == 1)
     {
         return(Nominator.ToString());
     }
     else
     {
         return(this.Nominator + "r" + this.Denominator);
     }
 }
示例#2
0
        public override string ToString()
        {
            string result = "";

            if (!Sign)
            {
                result += "-";
            }

            result += Nominator.ToString();
            result += "/";
            result += Denominator.ToString();

            return(result);
        }