Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package contest;
- /**
- *
- * @author cse1
- */
- import java.math.BigInteger;
- import java.util.Scanner;
- public class solution {
- public static void main(String args[]){
- Scanner sc=new Scanner(System.in);
- // Create 3 BigInteger objects
- BigInteger biginteger1, biginteger2, result;
- // Intializing all BigInteger Objects
- biginteger1 = new BigInteger("15");
- biginteger2 = new BigInteger("100");
- BigInteger exponent = new BigInteger(sc.nextLine());
- // Perform modPow operation on the objects and exponent
- result = biginteger1.modPow(exponent, biginteger2);
- // String expression = biginteger1 + "^" + exponent + " % "
- //+ biginteger2 + " = " + result;
- // Displaying the result
- System.out.println(result);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement