Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
J
Java_2
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
9831110
Java_2
Commits
ad3553b1
Commit
ad3553b1
authored
Feb 22, 2020
by
alireza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
asdadsad
parents
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
53 additions
and
0 deletions
+53
-0
Main.java
src/Main.java
+53
-0
No files found.
src/Main.java
0 → 100644
View file @
ad3553b1
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"
);
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment