import org.henan.util.SystemIn;public class ZuShu{
public static long zuHeShu(){
int a=0;
int b=0;
System.out.println("input two numbers: ");
a=SystemIn.readerInt();
b=SystemIn.readerInt();
String str1=Integer.toString(a);
String str2=Integer.toString(b);
String str3=str1+str2;
long l=Long.parseLong(str3);
return l;
}
public static int weiShu(long c){
int counter=0;
do{
counter++;
}while(c/10!=0);
return counter;
}
public static long zuiGaoWei(long d){
while(d/10!=0.0){
d=d/10;
}
return d;
}
public static void main(String args[]){
int a=0;
int b=0;
long l=0;
int num=0;
long heightest=0;
l=zuHeShu();
System.out.println(l);
num=weiShu(l);
System.out.println(num);
heightest=zuiGaoWei(l);
System.out.println(heightest);
}
}为何函数weiShu()和zuiGaoWei()调用不了?请给改改..
解决方案 »
- 关于静态属性,有个地方搞不太懂
- java中多线程七种状态 如何理解 以及状态之间的转换条件
- 请高手帮忙看看类型转化的问题,谢谢了
- 请帮我做几个题目
- 求助!我在applet类里实例化一个类并启动另外一个线程运行,实例化的这个类调用一个配置文件subxcribe.config,运行是提示java.io.FileNotFo
- 简单问提一个!
- Jave 2D射击小游戏视频及源码
- 继续求JAVA小程序的源代码
- 为什么System.out.println(new DataInputstream.readShort())不是期望的值?
- Collections.sort()方法,已经实现Comparable接口,为什么无法将Vector排序?
- Object...args?
- 求教:什么是java的复合类
b=SystemIn.readerInt();
这里错了,应该是:
a = System.in.read();
b = System.in.read();但是要注意,即使这样改也不能达到你程序想要的目的。System.in.read()读入的是你输入的字符的ASC码值而不是数值。这里需要用到java.util.Scanner,应改为如下:Scanner scanner = new Scanner(System.in);
a = scanner.nextInt();
b = scanner.nextInt();
num=ZuShu.weiShu(l);
heightest=ZuShu.zuiGaoWei(l);