-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparse.java
More file actions
30 lines (29 loc) · 789 Bytes
/
Copy pathparse.java
File metadata and controls
30 lines (29 loc) · 789 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
29
30
package javatest;
import java.util.Scanner;
import static java.lang.IO.*;
public class parse {
public static void main(String[] args) {
Scanner ab=new Scanner(System.in);
String s1=ab.next();
String s2=ab.next();
String y1="";
String y2="";
int t=s1.length();
int y=s2.length();
for(int i =0;i<t;i++) {
char c=s1.charAt(i);
if(c == '0' || c == '1' || c == '2' || c == '3' || c == '4' || c == '5' || c == '6' || c == '7' || c == '8' || c == '9') {
y1=y1+c;
}
}
for(int i =0;i<y;i++) {
char c=s2.charAt(i);
if(c == '0' || c == '1' || c == '2' || c == '3' || c == '4' || c == '5' || c == '6' || c == '7' || c == '8' || c == '9') {
y2=y2+c;
}
}
int u=Integer.parseInt(y1);
int v=Integer.parseInt(y2);
System.out.println(u+v);
}
}