Editorial
In the C language, it is not possible to express the condition directly. Let's combine the conditions and using the “and” operator ().
Algorithm realization
Read the input data.
scanf("%d %d %d", &x, &a, &b);
Print the answer depending on whether belongs to the interval .
if (x >= a && x <= b) printf("YES\n"); else printf("NO\n");
Java realization
import java.util.*; public class Main { public static void main(String[] args) { Scanner con = new Scanner(System.in); int x = con.nextInt(); int a = con.nextInt(); int b = con.nextInt(); if (x >= a && x <= b) System.out.println("YES"); else System.out.println("NO"); con.close(); } }
Python realization
Read the input data.
x, a, b = map(int,input().split())
Print the answer depending on whether belongs to the interval .
if x >= a and x <= b: print("YES") else: print("NO")
Python realization — the concise condition
Read the input data.
x, a, b = map(int,input().split())
Print the answer depending on whether belongs to the interval .
if a <= x <= b: print("YES") else: print("NO")