求long整数的位数( 能求负数位数,包括0也能求出位数,要用Scanner输入)
只能用+ - * / 还有下面的语法。。
http://docs.oracle.com/javase/8/docs/api/java/lang/Math.html#addExact-int-int-
而且只能用一条公式表达出==
请各位大神帮忙!
补充一下。只能用提供网站的method来编程、、谢谢各位大神
只能用+ - * /, and the methods in the Math class in the website.
It must be a one-line formula using only the allowable operations above。(老师原话,不太会翻译专业术语不好意思)
语法?一条公式?搞不清你说的是什么意思。
没仔细看你的要求,重新修改了一下。
请说的专业一点吧。越看越坑,“只能用提供网站的class来编程”实在是听不懂。
追问只能用+ - * /, and the methods in the Math class in the website.
It must be a one-line formula using only the allowable operations above。
我翻译得不好。以上英文是老师原话,我不会翻译成中文。
应该是只能网站里面的method,不好意思。我是刚刚学java的
能不能用到网页的method。。这里try,catch 和while我还没学过~
追答没事,不会就去掉,那个只是防止页面输入不是非数字的时候做的一个提醒。你直接去掉try cath这一段,这么写就行:Long data = input.nextLong();