double x = sc.nextDouble(); if( x < 0 || x > 100 ) { System.out.println( "x je záporné nebo větší nez 100" ); }