import java.math.BigInteger; import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); int k = 1; while (t > 0) { --t; BigInteger a = sc.nextBigInteger(); char op = sc.nextChar(); BigInteger b = sc.nextBigInteger(); if (op == '+') System.out.println(a.add(b)); else System.out.println(a.subtract(b)); } } } /* Main.java:12: error: cannot find symbol char op = sc.nextChar(); ^ symbol: method nextChar() location: variable sc of type Scanner 1 error */ |
Double click to view unformatted code.