C language the bonus issued by the enterprise is based on the profit commission , why can t I make

Updated on technology 2024-03-29
8 answers
  1. Anonymous users2024-02-07

    Your problem is a problem of 100 examples of programming, and the first algorithm is wrong: if(a<=100000) printf("%ld",(;This is right but wrong here if(a<=200000) printf("%ld",;Here you count the extra part of the bonus, and you don't count the extra part. The same is true for the rest later, and if else is too confusing, you can use if else if else if else if ...In this way, the program will not be written for you, and I believe that you have the source** Add:

    main() adds: Isn't it written incorrectly? Your program logic is wrong, and there are multiple layers of if else are also confused

    Thank you very much, I know how wrong my approach is, and my algorithm is actually right, and I add ...... to each of themIt's the bonus that doesn't exceed the part or thank you very much Follow-up question: Those braces in the middle It's useless to remove them I've tried the output or 0 : Of course there's no right answer to your if statement is messed up, and it's easy for you to want a structure that isn't 0.

    0 on the line.

  2. Anonymous users2024-02-06

    The program has been debugged. Your problem is that when integer data A is multiplied by floating-point data, the result is stored as floating-point data. If you output in long integer format, the program will judge that there is an error, and the output will be represented by 0.

    So, I changed the format output to a floating-point output. The last one is used. The 2f output, which does not indicate the data length, is because beyond a million, there is much larger data, and doing so will reduce errors.

    includevoid main() adds: I tried to run it with the program you wrote, and the output is 0. My explanation above for a result of 0 is wrong, sorry.

    I'm not quite sure why. Addendum: My output here is also 0

    I've modified the method above.,As for why the result is 0.,It should be a problem with the computer reading.。 How to read it,I don't know exactly.。。

  3. Anonymous users2024-02-05

    By the way, they're right, because when you multiply the decimal by the whole shape, the result becomes zero!

  4. Anonymous users2024-02-04

    case 10:

    default:

    w=(a[i]-1000000)*;break;

    More than 110w you don't give bonuses. It's ruthless.

    Digression: This bonus is very tangled, and it will sell 40w more later, so I will give 6,000 yuan, and I will directly give the business to the competing company to take extra money.

  5. Anonymous users2024-02-03

    16 unsigned int 0 65535, 32 bits of 0 2(32)-1 to start defining the array, which should be a long integer, long unsigned a[12].

  6. Anonymous users2024-02-02

    1.First of all, your 'greater than *** and less than or equal to *** is similar to this kind of writing error, which cannot be expressed in C like in mathematics, but should be 'x>**and x<=***

    2.Secondly, there is a problem with your moderation and the calculation formula is incorrect, such as: when the profit is higher than 100,000 yuan and less than 200,000 yuan, the part less than 100,000 yuan will be paid 10%, and the part higher than 100,000 yuan can be commissioned; Your formula goes like this --if(1000003In if(200000, you follow the step-by-step analogy of the three mistakes I gave you.

    The double type should be '%lf'

    It is recommended that you correct it in the second way that you wrote yourself.

  7. Anonymous users2024-02-01

    Hello landlord!!

    10% of usage in C is wrong!!

    10% should be converted, and the same goes for the followers!!

  8. Anonymous users2024-01-31

    The 2nd floor explains well, 17500 is 100000*, the landlord's calculation method is correct, the wrong thing is not to know the use of the expression in c;

Related questions
10 answers2024-03-29

In the C language, files can be divided into ASCI files and binary files according to the way the data is organized. ASC code. >>>More

9 answers2024-03-29

Scope. You static char *chh;

static char *ch1;Although the address pointed to by the two pointers does not change, have you ever wondered whether the memory address they point to has been released, char chc[10]; It's local, the function is out, the lifecycle is over, and you're trying to access it with a pointer in void times(). >>>More

11 answers2024-03-29

Valid variable names for the C language:

First, it can only contain numbers, letters, and underscores. >>>More

5 answers2024-03-29

These are not macro definitions, these are file containments. >>>More

3 answers2024-03-29

Computer Level 2C language question types and scoring criteria: 1. Multiple choice questions: 40 questions, 1 point for each question. Points are given according to the standard answers. >>>More