新手请教.--cannot find symbol
当我在编译的时候出现的一个问题.E:\jpp>javac LotteryOdds.java
LotteryOdds.java:10: cannot find symbol
symbol : method nextIn()
location: class java.util.Scanner
int n = in.nextIn();
^
1 error
这个应该怎么样解决啊?
我的环境变量设置为:
classPath
.;E:\java\JDK\lib\dt.jar;E:\java\JDK\lib\tools.jar;
程序源码为:
import java.util.*;
public class LotteryOdds
{
public static void main(String[] args)
{
Scanner in = new Scanner(System.in);
System.out.print("How many numbers do yow need to draw?");
int n = in.nextIn();
int lotteryOdds = 1;
for(int i=1;i<=n;i++){
lotteryOdds = lotteryOdds * (n-i+1)/i;
}
System.out.println("Your odds are 1 in "+lotteryOdds+" Good Luck!");
}
}
[ 本帖最后由 xkrumeng 于 2010-8-17 11:56 编辑 ]