Advertisement
FahimFaisal

Contest5_fifteen

Mar 10th, 2020
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.05 KB | None | 0 0
  1. /*
  2.  * To change this license header, choose License Headers in Project Properties.
  3.  * To change this template file, choose Tools | Templates
  4.  * and open the template in the editor.
  5.  */
  6. package contest;
  7.  
  8. /**
  9.  *
  10.  * @author cse1
  11.  */
  12.  
  13. import java.math.BigInteger;
  14. import java.util.Scanner;
  15. public class solution {
  16.  
  17.  
  18.   public static void main(String args[]){
  19.  Scanner sc=new Scanner(System.in);
  20.  
  21. // Create 3 BigInteger objects
  22.         BigInteger biginteger1, biginteger2, result;
  23.  
  24.         // Intializing all BigInteger Objects
  25.         biginteger1 = new BigInteger("15");
  26.        
  27.        biginteger2 = new BigInteger("100");
  28.         BigInteger exponent = new BigInteger(sc.nextLine());
  29.  
  30.         // Perform modPow operation on the objects and exponent
  31.         result = biginteger1.modPow(exponent, biginteger2);
  32.        // String expression = biginteger1 + "^" + exponent + " % "
  33.                             //+ biginteger2 + " = " + result;
  34.  
  35.         // Displaying the result
  36.         System.out.println(result);
  37.    
  38.   }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement