Skip to content

Instantly share code, notes, and snippets.

@silavsale
Last active October 25, 2016 03:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save silavsale/9e187def44401f2400d7869ff1218931 to your computer and use it in GitHub Desktop.
Save silavsale/9e187def44401f2400d7869ff1218931 to your computer and use it in GitHub Desktop.
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