-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBorze.java
More file actions
28 lines (27 loc) · 706 Bytes
/
Borze.java
File metadata and controls
28 lines (27 loc) · 706 Bytes
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
import java.util.Scanner;
public class Borze {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
String s=sc.next();
for(int i=0;i<s.length();i++)
{
if(s.charAt(i)=='.')
{
System.out.print(0);
}
else if(s.charAt(i)=='-')
{
if(i+1<s.length()&&s.charAt(i+1)=='.')
{
System.out.print(1);
}
else if(i+1<s.length()&&s.charAt(i+1)=='-')
{
System.out.print(2);
}
i++;
}
}
sc.close();
}
}