Commit ad3553b1 authored by alireza's avatar alireza

asdadsad

parents
import java.util.Scanner;
public class Main {
public static boolean func(String input,String format){
int first_star=format.indexOf('*');
String s1,s2;
if(first_star==0)
{
}
else
{
s1=format.substring(0,first_star);
s2=input.substring(0,first_star);
System.out.println(s1+"\n"+);
if(!s1.equals(s2))
return false;
}
return false;
}
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
String format=sc.nextLine();
String input=sc.nextLine();
if(format.indexOf('!')!=-1)
{
int index=format.indexOf('!');
format=format.substring(0,index)+format.charAt(index-1)+format.substring(index+1);
// System.out.println(format);
// System.out.println(input);
if(format.equals(input))
System.out.printf("true");
else
System.out.println("false");
}
else
{
if(func(input,format) && format.indexOf('*')!=-1)
{
System.out.println("True");
}
else
System.out.println("false");
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment