解题思路:
注意事项:
参考代码:
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b = sc.nextInt();
System.out.println(reverse(reverse(a)+reverse(b)));
}
public static int reverse(int n){
int weishu = Integer.toString(n).length();
int i=0;
int result=0;
while(n!=0){
i=n%10;
result+=Math.pow(10, weishu-1)*i;
weishu--;
n/=10;
}
return result;
}
}
0.0分
2 人评分