示例#1
0
        static void Main(string[] args)
        {
            string V1, V2, V3;

            Console.WriteLine("Entrez trois noms : ");
            V1 = Console.ReadLine();
            V2 = Console.ReadLine();
            V3 = Console.ReadLine();

            if (V1.CompareTo(V2) == 0 && V2.CompareTo(V3) == 0)
            {
                Console.WriteLine("Ces noms sont classés");
            }
            else
            {
                Console.WriteLine("Ces noms ne sont pas classés");
            }

            Console.ReadKey();
        }
示例#2
0
        public int CompareTo(FaceIndexTriplet other)
        {
            if (ReferenceEquals(this, other))
            {
                return(0);
            }
            if (ReferenceEquals(null, other))
            {
                return(1);
            }
            var v1Comparison = V1.CompareTo(other.V1);

            if (v1Comparison != 0)
            {
                return(v1Comparison);
            }
            var v2Comparison = V2.CompareTo(other.V2);

            if (v2Comparison != 0)
            {
                return(v2Comparison);
            }
            return(V3.CompareTo(other.V3));
        }