class Teste {
while (c.length() < d.length()) c = "0" + c;
while (c.length() > d.length()) d = "0" + d;
return c.compareTo(d);
}
public static void main
(String[] args
) { System.
out.
println(seuComparador
("0",
"3")); System.
out.
println(seuComparador
("10",
"3")); System.
out.
println(seuComparador
("007",
"300")); System.
out.
println(seuComparador
("40",
"040")); }
}
Y2xhc3MgVGVzdGUgewoKICAgIHB1YmxpYyBzdGF0aWMgaW50IHNldUNvbXBhcmFkb3IoU3RyaW5nIGEsIFN0cmluZyBiKSB7CiAgICAgICAgU3RyaW5nIGMgPSBhOwogICAgICAgIFN0cmluZyBkID0gYjsKICAgICAgICB3aGlsZSAoYy5sZW5ndGgoKSA8IGQubGVuZ3RoKCkpIGMgPSAiMCIgKyBjOwogICAgICAgIHdoaWxlIChjLmxlbmd0aCgpID4gZC5sZW5ndGgoKSkgZCA9ICIwIiArIGQ7CiAgICAgICAgcmV0dXJuIGMuY29tcGFyZVRvKGQpOwogICAgfQoKICAgIHB1YmxpYyBzdGF0aWMgdm9pZCBtYWluKFN0cmluZ1tdIGFyZ3MpIHsKICAgICAgICBTeXN0ZW0ub3V0LnByaW50bG4oc2V1Q29tcGFyYWRvcigiMCIsICIzIikpOwogICAgICAgIFN5c3RlbS5vdXQucHJpbnRsbihzZXVDb21wYXJhZG9yKCIxMCIsICIzIikpOwogICAgICAgIFN5c3RlbS5vdXQucHJpbnRsbihzZXVDb21wYXJhZG9yKCIwMDciLCAiMzAwIikpOwogICAgICAgIFN5c3RlbS5vdXQucHJpbnRsbihzZXVDb21wYXJhZG9yKCI0MCIsICIwNDAiKSk7CiAgICB9Cn0=