-
-
Save folivetti/8bcd291ad1efcc182b4d6ea70600241e to your computer and use it in GitHub Desktop.
This file contains 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; | |
class Main { | |
public static void main(String[] args) { | |
int n, i; | |
double soma = 0; | |
Scanner leitor = new Scanner(System.in); | |
n = leitor.nextInt(); | |
for (i=1; i<=n; i++) { | |
soma += 1.0/(i*i); | |
} | |
System.out.println(Math.sqrt(6*soma)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment