Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.company;
- import java.io.IOException;
- import java.util.Scanner;
- public class Main {
- private static Scanner in = new Scanner(System.in);
- public static void main(String[] args) {
- double x = nextSafeDouble();
- }
- private static double nextSafeDouble()
- {
- double temp = 0;
- do
- {
- try
- {
- temp = in.nextDouble();
- break;
- }
- catch (Exception e)
- {
- System.out.println ("Неверные данные");
- }
- } while(true);
- return temp;
- }
- /*private static double calculate(double x, double y)
- {
- return (Math.abs(Math.sin(x) - y) + 2 * x) / (Math.sqrt(1 + Math.abs(x * y)));
- }*/
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement