Last active
November 6, 2020 13:04
-
-
Save hypnguyen1209/d43685243c6e7677dfefd6769cadf71c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.Scanner; | |
| import java.lang.Math; | |
| public class bai2 { | |
| public static void main(String args[]) { | |
| Scanner in = new Scanner(System.in); | |
| System.out.println("m: "); | |
| int m = in.nextInt(); | |
| System.out.println("n: "); | |
| int n = in.nextInt(); | |
| System.out.println(compute(m, n)); | |
| } | |
| private static double compute(int m, int n) { | |
| double result = 0; | |
| for(int i = 0; i < n; i++) { | |
| result = Math.sqrt(m + result); | |
| } | |
| return result; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment