Skip to content

Instantly share code, notes, and snippets.

@Jack-Saleem
Created January 15, 2016 13:14
Show Gist options
  • Select an option

  • Save Jack-Saleem/2ba6771f9273ed55836f to your computer and use it in GitHub Desktop.

Select an option

Save Jack-Saleem/2ba6771f9273ed55836f to your computer and use it in GitHub Desktop.
Codeforces 112A PetyaAndStrings program in java
import java.util.Scanner;
public class PetyaStrings
{
public static void main(String args[])
{
Scanner ip = new Scanner(System.in);
String x=ip.next();
String y=ip.next();
int z = x.compareToIgnoreCase(y);
if(z==0)
System.out.println(0);
else if(z>0)
System.out.println(1);
else
System.out.println(-1);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment