N
N
nak-alexey2019-11-04 22:02:01
bash
nak-alexey, 2019-11-04 22:02:01

How would you implement such a validation algorithm?

For example, there is the following code:

if ( (a >= 10) && (b <= 15) ) {print();}
if ( (a >= 30) && (b <= 35) ) {print();}
              
if ( (a <= 10) && (b >= 15) ) {print();}
if ( (a <= 30) && (b >= 35) ) {print();}

Is there any way to make this check shorter?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
DanielMcRon, 2019-11-04
@DanielMcRon

I would leave it like that

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question