Redaksiya
Let's combine the conditions and using the or operator.
Algorithm realization
Read the input data.
scanf("%d %d %d", &x, &a, &b);
Print the answer depending on whether the number is outside or inside the interval .
if (x < a || x > b) printf("OUT\n"); else printf("IN\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("OUT"); else System.out.println("IN"); con.close(); } }
Python realization
Read the input data.
x, a, b = map(int,input().split())
Print the answer depending on whether the number is outside or inside the interval .
if x < a or x > b: print("OUT") else: print("IN")