F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

View Compilation Error

0_0_17334205_27670\Main.java:1: 错误: 解析时已到达文件结尾
import java.math.BigInteger; import java.util.Scanner; public class Main { 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_17334205_27670\Main.java:1: 错误: 解析时已到达文件结尾
import java.math.BigInteger; import java.util.Scanner; public class Main { 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(); } }
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     ^
2 个错误


Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-11-26 23:27:13, Gzip enabled