import java.io.BufferedInputStream;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(new BufferedInputStream(System.in));
while(in.hasNext()){
String A = in.next();
String B = in.next();
A = A.replace(",", "").trim(); // 这句话是干什么用的
B = B.replace(",", "").trim();
//System.out.println(strA);
Integer numA = Integer.parseInt(A); // 这句话是不是把A转化成int型?
Integer numB = Integer.parseInt(B);
System.out.println(numA + numB);
}
}
}
hdu 3787 java 求解释代码什么意思
replace(",","") 把逗号去掉 trim()把字符串前后的空格去掉。Integer numA = Integer.parseInt(A); 是把字符串A转换成Integer类型。