Home > Back-end >  > b> a, c a, how to use c programming language to preserve and judge not necessarily bigger th
> b> a, c a, how to use c programming language to preserve and judge not necessarily bigger th

Time:09-15

What a way to save and the logical relationship between b and c?

Such as input condition is:

B> A, c> A,

If such save

If (b> A)

B=2, a=1;

If (c> A)

C=a + 1;

The c=2;

If (b==c)//b==2, c==2

Output size b and c uncertain.

The else

B and c size

O

But there is a problem here

If c> B> A, e> D> A

Set a=1 so

B=2, c=3

D=2, e=3

If judged according to equal

Judgment method:

If (c==e)

Print (" relationship between c and e not sure ")

The else

Print (" relationship between c and e can determine ")



But so b and e can also determine the relationship between, because b!=e,

In fact the relationship between b and e not sure

If the collection to save this relationship, the said upper limit of the set?

Input: b> A, c> A

Set a=100,

B=[101, infinity]

C=[101, infinity]

Input increases d> B is to: d> B> A, c> A

Assignment to d:

D=[[0] b + 1, infinity] is d=[102, infinity]

So whether d is greater than a just judge d [0] is greater than a [0], is a collection of inclusion relation is used to judge the

If the input

e> C is a: d> B> A, e> C> A

E assignment:

E should be [[0] c + 1, infinity] : [101 + 1, infinity] [102, infinity]

A collection of e and d, e and d uncertain

Question:

If added a f> E: d> B> A, f> e> C> A

For the f value assignment should be: f=[e [0] + 1, infinity] or [103, infinity]

F=[103, infinity] and d=[102, infinity] f [0] & gt; D [0], f is larger than d! In fact the relationship between f and d not sure! This contradiction

If such improvements:

Condition: b> A, c> A

Set a=100,

Int x=a specific number

B=[101] x

C=[101] x

So save

If the input:

D> B d> namely; B> A, c> A

If set d=[x + 1, x * 2] being each number is greater than b, d

In fact that is problematic,

Determine a specific number of x? Set a freely? Such as 10000, but it still has bugs

Can't write here.. This bug is easy to think of here don't write for a while.

So how to save such a logic relation?

CodePudding user response:

Didn't understand your purpose, the relationship between b and c should be uncertain, so it should be the or to describe the relationship between
C> namely;=b | | c<=b

CodePudding user response:

According to your description, to save the logic relationship, my advice is to not die can use tree?

CodePudding user response:

The building Lord, you have a logical problem:
If (c==e)
Print (" relationship between c and e not sure ")
The else
Print (" relationship between c and e can determine ")

C==e not sure when unexpectedly is relationship? This logic to tell I can't understand, could you go into more detail about?