/***************************  Zeichenkette.java  ******************************/

import AlgoTools.IO;

/**  Interpretiert zwei eingelesene Zeichenfolgen als Strings
 *   und vergleicht sie.
 */

public class Zeichenkette {

  public static void main (String argv[]) {

    char[] s, t;                          // Felder von Zeichen
    int i;                                // Laufindex
    
    s = IO.readChars("Bitte einen String: ");
    t = IO.readChars("Bitte einen String: ");

    i = 0;

    while (true) {                        // s und t gelten so lange als gleich,
                                          // bis ein String zu Ende ist oder
                                          // zwei Buchstaben sich unterscheiden
    
      if ((i==s.length) && (i==t.length)) { IO.println(s + " = " + t); break;}
      if ( i==s.length)                   { IO.println(s + " < " + t); break;}
      if ( i==t.length)                   { IO.println(s + " > " + t); break;}
      if ( s[i] < t[i])                   { IO.println(s + " < " + t); break;}
      if ( s[i] > t[i])                   { IO.println(s + " > " + t); break;}
      
      i++;
    }
  }
}
