hc学习平台

 找回密码
 立即注册
搜索
热搜: 活动 交友 javakc
 › fsrm › 日志

得到一个整数的绝对值  

2022-07-11 19:03:34 查看(5) 回复(0)

请编写一个方法实现如下功能:得到一个整数的绝对值
public static void main(String[] args) {
        demo count = new demo();
        Scanner scan = new Scanner(System.in);
        System.out.println("请输入数字");
        int x = scan.nextInt();
        System.out.println(count.abs(x));
    }
public static int abs(int x){
        return Math.abs(x);
    }

评论 (0 个评论)

facelist

全部作者的其他最新日志



站点统计|举报|Archiver|手机版|小黑屋|Comsenz Inc.

GMT+8, , Processed in 0.195171 second(s), 9 queries .

Powered by javakc! X1.0

© 2004-2014 javakc

f1208.com 备案号:京ICP备14030918号-1

返回顶部