2017年省赛前最后一水---C题

来源:互联网 发布:java 转二进制 编辑:程序博客网 时间:2024/06/02 06:33

问题 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****************************************************************/
0 0