Startup and Tech
Tuesday, 21 July 2020
Codeforces 112a Petya And Strings Problem Solution In Java
Program
import java.util.*; public class x { public static void main(String args[]) { Scanner sc = new Scanner(System.in); String s1 = sc.next(); String s2 = sc.next(); int n1 = s1.compareToIgnoreCase(s2); if(n1>0) { System.out.println(1); } else if(n1<0) { System.out.println(-1); } else { System.out.println(0); } } } }
Output
I/P : ----- aaaa aaaA ----- O/P : 0
Codeforces 282A - Bit++ Problem Solution In Java
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment