-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStudy_2935.java
More file actions
54 lines (50 loc) · 1.04 KB
/
Study_2935.java
File metadata and controls
54 lines (50 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import java.util.*;
// Create by Inho 2018. 4. 16. 오후 12:05:59
// 2935 소음
public class Study_2935 {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
String a = scanner.nextLine();
String i = scanner.nextLine();
String b = scanner.nextLine();
int a_size = a.length();
int b_size = b.length();
if(i.equals("*")){
System.out.print(1);
for(int j = 0;j<a_size+b_size-2;j++){
System.out.print(0);
}
System.out.println();
}else if(i.equals("+")){
if(a_size > b_size){
System.out.print(1);
for(int j=0;j<a_size-1;j++){
if(j==a_size-b_size-1){
System.out.print(1);
}
else{
System.out.print(0);
}
}
}else if(a_size < b_size){
System.out.print(1);
for(int j=0;j<b_size-1;j++){
if(j==b_size-a_size-1){
System.out.print(1);
}
else{
System.out.print(0);
}
}
}else{
for(int j=0;j<a_size;j++){
if(j==0){
System.out.print(2);
}else{
System.out.print(0);
}
}
}
}
}
}