A is a positive number with a decimal, and B is a negative number with a decimal is described in C

Updated on educate 2024-05-18
9 answers
  1. Anonymous users2024-02-10

    This problem can be divided into two parts, how to describe a number with decimals, and how to describe the positive and negative aspects of a number.

    One, describe the positive and negative.

    You can directly use judgment statements, use mathematical properties, and compare with 0.

    if(a>0) means that the number is positive.

    if(b<0) indicates that the number is negative.

    2. Determine whether there are decimals.

    Casting a float type to an int type in C will only retain the integer part of the value. Take advantage of this, you can use expressions.

    a-(int)a to get the decimal part of the floating-point number a, and then compare it with 0 to determine whether the decimal part exists.

    i.e. if(a-(int)a!= 0)

    Everything is correct in theory, but sometimes it is wrong in practice because floating-point numbers have precision limitations, and the stored values are not exact but approximate. So in general, when the difference is less than one precision, the value is considered to be 0. For floats, the accuracy is generally set to 1e-6.

    So the judgment expression can be written:

    if(fabs(a-(int)a) >1e-6)

    3. To sum up, the expressions required in the title can be written:

    if((fabs(a-(int)a) >1e-6 &&a>0) &fabs(b-(int)b) >1e-6 &&b<0))

  2. Anonymous users2024-02-09

    float a,b;(The highest digit of A is 0, and the highest digit of B is 1).

  3. Anonymous users2024-02-08

    i.e., A+

    Because of the false shot, a is an integer.

    So it must also be an integer.

    There is only one value for b=5.

    There are (1) lines with decimals, and the sum of all these decimals is (5).

  4. Anonymous users2024-02-07

    Composed. a is the smallest positive integer, a=1

    b is the negative integer of the maximum percolation scale, b = -1

    c is the number of the inverse number of the phase cong ruler eggplant equal to itself, c = 0

    Rule. a+(-b)+c=1+ -1) +0=1+1=2

  5. Anonymous users2024-02-06

    If 0 is not a positive number or a negative number, then the A and B options are wrong;

    0 also tells Lu that if it is not the smallest with a stupid number, then c is wrong;

    0 is a knowing simple with an integer, then d is correct;

    Therefore, choose D

  6. Anonymous users2024-02-05

    According to a is the smallest positive integer pure ant, b is the largest negative integer, which level c is the number with the smallest absolute value, so a=1, b=-1, c=0

    So a-b+c=1-(-1)+0=2

    Therefore, choose D

  7. Anonymous users2024-02-04

    It is known that a is the smallest positive integer, a=1;

    The opposite of b is itself, b=0, c is the largest negative integer, c=-1;

    a|+|b|+|c|=|1|+|0|+|1|=1+0+1=2

  8. Anonymous users2024-02-03

    7 This is the result of the calculation, see the figure for detailed steps.

  9. Anonymous users2024-02-02

    a is the smallest positive integer, a=1, m is the number of integers greater than minus 4 and less than 3, m=6, b is the smallest non-negative number, b=0, a-b+m=1-0+6=7

Related questions
18 answers2024-05-18

Isn't it based on love that you marry a woman? How can it be measured by bringing daughters and sons? You have to love that person, and you are willing to accept it, no matter how heavy her burden is. >>>More

13 answers2024-05-18

This situation is complicated, if it is IBIB IAIA, the child's blood type is AB; In the case of IBI IAIA, the child's blood type may be AB or A; iBI IAI, blood type can be AB, A, B, O; ibib×iai;The blood type is AB or B. All in all, this is the most complex combination, which can encompass almost all blood types of ABO...

4 answers2024-05-18

Write not to give in to the forces of evil.

41 answers2024-05-18

First, move out of the woman's household registration, and go to the police station with the woman's move-out certificate and your unit's move-in certificate.

7 answers2024-05-18

If you are in love, I think you can choose someone you like, but if you are married, you must choose someone who likes you, so that you can have the initiative in marriage.