问题 C: a*b%c 时间限制: 1 Sec 内存限制: 128 MB 提交: 248 解决: 58 [提交][状态][讨论版] 题目描述 Lucy give you three number a,b,c. You should tell Lucy the answer of a*b%c 输入 The first line of the input gives the number of test cases, T(1
import java.math.BigInteger; import java.util.Scanner; public class Main{ public static void main(String[] args){ Scanner cin = new Scanner(System.in); int n; n = cin.nextInt(); int index = 0; while(n--!=0) { index++; BigInteger a,b,c; a = cin.nextBigInteger(); b = cin.nextBigInteger(); c = cin.nextBigInteger(); System.out.println("Case #"+index+": "+a.multiply(b).mod(c)); } } } /************************************************************** Problem: 1013 User: T032 Language: Java Result: 正确 Time:1040 ms Memory:8688 kb ****************************************************************/