1Scanner sc = new Scanner(System.in);
2 int a = sc.nextInt();//the number of which i want to find the root
3 System.out.println("enter the root:");
4 int rootNum = sc.nextInt();//the N-th number root
5 double powerOf = 1;
6 double sqrt = 0;
7 double b = 1;
8 while (a > b) {
9 sqrt = powerOf + 0.0000001;//flexible
10 powerOf = sqrt;
11 for(int i = 1; i < rootNum; i++) {
12 b = sqrt*powerOf;
13 sqrt = b;
14 }
15 }
1 Scanner sc = new Scanner(System.in);
2 int a = sc.nextInt();//the number of which i want to find the root
3 System.out.println("enter the root:");
4 int rootNum = sc.nextInt();//the N-th number root
5 double powerOf = 1;
6 double sqrt = 0;
7 double b = 0;
8 while (a > b) {
9 sqrt = powerOf + 0.0000001;//flexible
10 powerOf = sqrt;
11 for(int i = 1; i < rootNum; i++) {
12 b = sqrt*powerOf;
13 sqrt = b;
14 }
15 }