- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprogrammers81301.java
More file actions
Latest commit
24 lines (20 loc) · 691 Bytes
/
Copy pathprogrammers81301.java
File metadata and controls
24 lines (20 loc) · 691 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
packageProgrammers;
importjava.util.Scanner;
publicclassprogrammers81301 {
publicstaticvoidmain(String[] args) {
Solution81301sc = newSolution81301();
Scannerin = newScanner(System.in);
Stringinput = in.nextLine();
System.out.println(sc.solution(input));
}
}
classSolution81301 {
publicintsolution(Strings) {
String[] arr1 = {"zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"};
String[] arr2 = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"};
for(inti = 0; i < 10; i++){
s = s.replace(arr1[i] , arr2[i]);
}
returnInteger.parseInt(s);
}
}