Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class E813
- {
- private double x;
- private int y;
- public static void main(String[] args)
- {
- Scanner scan = new Scanner(System.in);
- System.out.println("enter integer here:");
- scan = new Scanner();
- }
- if (y < 0)
- {
- x = -1 / (Math.pow(x, y));
- }
- if (y.isEven && y.isPositive)
- {
- x = Math.pow(x, y/2);
- }
- if (y.isOdd && y.isPositive)
- {
- x = Math.pow(x, y-1);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement