wxj


私信TA

用户名:godjiang

访问量:1706

签 名:

你尽管去努力,剩下的交给天意

等  级
排  名 17580
经  验 724
参赛次数 0
文章发表 4
年  龄 21
在职情况 学生
学  校 广东技术师范大学
专  业 软件工程

  自我简介:

喜欢编程,喜欢java,喜欢数据结构,喜欢ssm框架,java相关的东西都有极大的兴趣


解题思路:

注意事项:

参考代码:

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 人评分

看不懂代码?想转换其他语言的代码? 或者想问其他问题? 试试问问AI编程助手,随时响应你的问题:

编程语言转换万能编程问答  

代码解释器

代码纠错

SQL生成与解释

  评论区