Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.*;
- import java.util.*;
- public class Solution {
- public static void main(String[] args) {
- String s1,s2;
- Scanner masuk = new Scanner(System.in);
- s1 = masuk.nextLine();
- s2 = masuk.nextLine();
- int x1=s1.length(), x2=s2.length();
- if (x1>20||x2>20)
- {
- System.out.print("ERROR");
- }
- else if ( x1==x2)
- {
- System.out.print("SAMA");
- }
- else if (x1<x2)
- {
- x1 = x2-x1;
- for (int j=1; j<=x1;j++)
- {
- s1 = " " +s1;
- }
- System.out.println(s1);
- System.out.print(s2);
- }
- else
- {
- x1 = x1-x2;
- for (int j=1; j<=x1;j++)
- {
- s2 = " "+s2;
- }
- System.out.println(s1);
- System.out.print(s2);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement