Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.company;
- import java.math.BigDecimal;
- import java.util.Scanner;
- public class Main {
- static BigDecimal getPowerNumber(BigDecimal number, int powNumber) {
- number = number.pow(powNumber);
- return number;
- }
- public static void main(String[] args) {
- Scanner scan = new Scanner(System.in);
- BigDecimal number =new BigDecimal(scan.nextLine());
- int powNumber = Integer.parseInt(scan.nextLine());
- BigDecimal result = getPowerNumber(number, powNumber);
- System.out.println(result);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement