import java.math.BigInteger; import java.util.Scanner; public class 大数相加 { public static void main(String[] args) { Scanner input = new Scanner(System.in); BigInteger[] A = new BigInteger[100]; while (input.hasNextBigInteger()) { A[0] = input.nextBigInteger(); A[1] = input.nextBigInteger(); A[2] = input.nextBigInteger(); for (int i = 3; i < 100; i++) { A[i] = A[i - 1].add(A[i - 2].add(A[i - 3])); } System.out.println(A[99]); } } } /* F:\temp\21561628.9674\Main.cc:5: error: stray '\264' in program F:\temp\21561628.9674\Main.cc:5: error: stray '\363' in program F:\temp\21561628.9674\Main.cc:5: error: stray '\312' in program F:\temp\21561628.9674\Main.cc:5: error: stray '\375' in program F:\temp\21561628.9674\Main.cc:5: error: stray '\317' in program F:\temp\21561628.9674\Main.cc:5: error: stray '\340' in program F:\temp\21561628.9674\Main.cc:5: error: stray '\274' in program F:\temp\21561628.9674\Main.cc:5: error: stray '\323' in program F:\temp\21561628.9674\Main.cc:2: error: 'import' does not name a type F:\temp\21561628.9674\Main.cc:3: error: 'import' does not name a type F:\temp\21561628.9674\Main.cc:5: error: expected unqualified-id before 'public' */ |
Double click to view unformatted code.