帮忙看看这程序的问题在哪?

Johnson545 2004-02-17 07:13:40
import java.lang.*;
import java.io.*;



public class Factor{

int result;
public int multi(int n){

int end = 0;
result = n;
while(n > 1){

--n;
result *= n;
}
return result;
}

public static void main(String args[]) throws IOException{

int res;
int x;

Factor f1 = new Factor();
if((x = System.in.read()) != -1){

System.out.println(x);
f1.multi(x);
System.out.println("The result is:" + f1.result);
}
}
}
...全文
28 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复

62,614

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧