Skip to content

Instantly share code, notes, and snippets.

@hypnguyen1209
Last active November 6, 2020 13:04
Show Gist options
  • Select an option

  • Save hypnguyen1209/d43685243c6e7677dfefd6769cadf71c to your computer and use it in GitHub Desktop.

Select an option

Save hypnguyen1209/d43685243c6e7677dfefd6769cadf71c to your computer and use it in GitHub Desktop.
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