0_0_17334215_5081\Main.java:2: 错误: 需要'{'
import java.util.Scanner; public class LX-1005 { public static void main(String[] args) { Scanner in = new Scanner(System.in); int a, b; int n; while (in.hasNext()) { a = in.nextInt(); b = in.nextInt(); n = in.nextInt(); // 1 <= A, B <= 1000, 1 <= n <= 100,000,000 if (a < 1 & a > 1000 & b < 1 & b > 1000 & b < 1 & a > 100000000) System.exit(0); if (a == 0 & b == 0 & n == 0) System.exit(0); int count = n - 2; int i = 0; BigInteger f[] = new BigInteger[2]; f[0] = BigInteger.valueOf(1); f[1] = BigInteger.valueOf(1); while (i < count) { BigInteger tmp = (f[0].multiply(BigInteger.valueOf(a)).add(f[1] .multiply(BigInteger.valueOf(b)))).remainder(BigInteger .valueOf(7)); f[1] = f[0]; f[0] = tmp; i++; } System.out.println(f[0]); } in.close(); } }
^
0_0_17334215_5081\Main.java:2: 错误: 解析时已到达文件结尾
import java.util.Scanner; public class LX-1005 { public static void main(String[] args) { Scanner in = new Scanner(System.in); int a, b; int n; while (in.hasNext()) { a = in.nextInt(); b = in.nextInt(); n = in.nextInt(); // 1 <= A, B <= 1000, 1 <= n <= 100,000,000 if (a < 1 & a > 1000 & b < 1 & b > 1000 & b < 1 & a > 100000000) System.exit(0); if (a == 0 & b == 0 & n == 0) System.exit(0); int count = n - 2; int i = 0; BigInteger f[] = new BigInteger[2]; f[0] = BigInteger.valueOf(1); f[1] = BigInteger.valueOf(1); while (i < count) { BigInteger tmp = (f[0].multiply(BigInteger.valueOf(a)).add(f[1] .multiply(BigInteger.valueOf(b)))).remainder(BigInteger .valueOf(7)); f[1] = f[0]; f[0] = tmp; i++; } System.out.println(f[0]); } in.close(); } }
^
0_0_17334215_5081\Main.java:2: 错误: 解析时已到达文件结尾
import java.util.Scanner; public class LX-1005 { public static void main(String[] args) { Scanner in = new Scanner(System.in); int a, b; int n; while (in.hasNext()) { a = in.nextInt(); b = in.nextInt(); n = in.nextInt(); // 1 <= A, B <= 1000, 1 <= n <= 100,000,000 if (a < 1 & a > 1000 & b < 1 & b > 1000 & b < 1 & a > 100000000) System.exit(0); if (a == 0 & b == 0 & n == 0) System.exit(0); int count = n - 2; int i = 0; BigInteger f[] = new BigInteger[2]; f[0] = BigInteger.valueOf(1); f[1] = BigInteger.valueOf(1); while (i < count) { BigInteger tmp = (f[0].multiply(BigInteger.valueOf(a)).add(f[1] .multiply(BigInteger.valueOf(b)))).remainder(BigInteger .valueOf(7)); f[1] = f[0]; f[0] = tmp; i++; } System.out.println(f[0]); } in.close(); } }
^
3 个错误
|