Last active
October 25, 2016 03:52
-
-
Save silavsale/9e187def44401f2400d7869ff1218931 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; | |
public class UmovnyiOperator { | |
//тернарний | |
public static void main(String[]args) | |
{ | |
System.out.println("Введіть свій номер:"); | |
Scanner scan = new Scanner(System.in); | |
int id = scan.nextInt(); | |
System.out.println("Ціна для вас: " + ((id >= 1000 && id <= 55000) ? 2.0 : 3.0) +"гр"); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment