Help me find C s fault, who will help me see where C s passage is wrong?

Updated on number 2024-02-09
9 answers
  1. Anonymous users2024-02-05

    Check your input method, it should be Chinese characters in it.

    if(x=0||y=0) should be if(x==0||y==0)

  2. Anonymous users2024-02-04

    The conditional judgment should be x==0||y==0

    Under the third line check, the semicolon under Chinese is not entered.

  3. Anonymous users2024-02-03

    The C++ procedure for the corrected high-precision division is as follows (see figure, see note for changes) <>

  4. Anonymous users2024-02-02

    Do you understand the logic of division? Don't rush to write**, use pen and paper to think clearly about the logic first.

    for(i=0;i<=100;i++)

    a=a*10;Take this sentence as an example, a=a*10, you didn't remove the integer part of a b, right? So the result must have been wrong.

    s+=char(a/b+'0');

    a=a%b;

  5. Anonymous users2024-02-01

    First of all, when you enter two array values, the input format is wrong:

    &a[m] and &a[q].

    Another mistake is that in C an equal sign is assigned to the variables on the left, which means that the result on the right is assigned to the variable on the left, so your.

    The place marked in red is always true, and it loses the meaning of judgment. == should be used to determine whether the two are equal.

  6. Anonymous users2024-01-31

    For an array of characters, if you use it as a string, its ending character is a character'\0'

    Two character arrays, a and b, may be concatenated when allocating memory, such as a 17-byte space, with the first 10 being a and the last 7 being b.

    When C processes strings, start with the first address until it is encountered'\0'

    It just so happens that if there is no one in the A array, it will search backwards until it comes across it'\0', so many books repeatedly emphasize the importance of the ending character, otherwise errors will often be reported. This will cross the line to array b and run into b'\0', it will stop, and if it is still not encountered, it will show even stranger.

    It's true that the array of a is only 10 characters, but since there is no terminator, and the spaces of a and b happen to be concatenated, the debugger does not use the original length of a to determine the content of the string when it displays the value according to the string. So there will be a strange display, and the output will also be abnormal.

  7. Anonymous users2024-01-30

    What is the original content in the buffer a, it is better to fill it all with zeromemory to 0

  8. Anonymous users2024-01-29

    In this case, the initial length of b is 0, and b[1] will cause the program to crash.

    You write it like this:

    a += string(,

    cout <

  9. Anonymous users2024-01-28

    Isn't the unconditional phrase of the k-cycle an endless loop?

Related questions
10 answers2024-02-09

Nokia C5-03 and ZTE V880** are both around 1,000 yuan, one Symbian system and one Android system, and the pixels are higher than 3 million. Mid-range smartphones, Nokia N, Samsung S5830. High-end smart phones, high-end phones are generally equipped with or more screens, so they are large. >>>More

10 answers2024-02-09

Li Shangyin's Untitled translation is: Last night the stars were shining, the wind was like water, I wandered to the west of the painting building, and all I thought about was you who lived in the east of Guitang. Although we are close at hand, it is as if we are separated by the end of the world; I hate myself, I don't have wings like a colorful phoenix to fly freely with you, and I can be glad that you and I are heart-to-heart with each other, and we know each other. 」

3 answers2024-02-09

Pony has seven seals and a true body, and the true body has six lives. >>>More

9 answers2024-02-09

Isn't it the Philharmonic Orchestra's loving you???

loving you >>>More

6 answers2024-02-09

Now, we're really alarmed by potassium iodide.

Before, I haven't seen you from something I don't like, why I'm disgusted and don't know how the queen- >>>More