Created
February 18, 2011 08:03
-
-
Save thetekst/833402 to your computer and use it in GitHub Desktop.
1.3 Java home
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; | |
import static java.lang.Math.sqrt; | |
public class HelloWorld { | |
/** | |
* @param args | |
*/ | |
public static void main(String[] args) { | |
Scanner scan = new Scanner(System.in); | |
String s = scan.nextLine(); | |
int b = Integer.parseInt(s); | |
System.out.println(sqrt(b)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment