题解 | #小乐乐改数字#

小乐乐改数字

http://www.nowcoder.com/practice/fcd30aac9c4f4028b23919a0c649824d

```import java.util.Scanner;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();
        StringBuilder strBuilder = new StringBuilder();
        while(num > 0){
            strBuilder.append((num % 10 % 2) == 0 ? 0 : 1);
            num /= 10;
        }
        int res = Integer.parseInt(strBuilder.reverse().toString());
        System.out.println(res);
    }
}
全部评论

相关推荐

见见123:简历没有啥问题,是这个社会有问题。因为你刚毕业,没有工作经历,现在企业都不要没有工作经历的。社会病了。
点赞 评论 收藏
分享
在debug的柠檬精很迷人:好消息:现在HR挑三拣四 15年后 HR跪着求要简历 坏消息:被挑的是这代人,到时候求人的也是这代人。真好。
点赞 评论 收藏
分享
我面试,她问我有女朋友没
不甜主义:考验稳定性,单身牛马更注意力集中
点赞 评论 收藏
分享
评论
3
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务