Ladies and gentlemen, please help me with a very simple C language problem, thank you

Updated on society 2024-04-08
10 answers
  1. Anonymous users2024-02-07

    Friend, I posted the ** by myself, not on the Internet, you copy my **, forget it, why bother looking for so many reasons?

  2. Anonymous users2024-02-06

    If they are all natural numbers, then they are all greater than 0.

    We're going to take out the ones and the maximum.

    Then the more you can achieve, the better.

    That's what it is.

    If I take (1,1) this 75

    Then I can also take (1, 3) 21, (2, 2) 15, (3, 1) 34, (3, 3) 5

    If I don't take (1,1).

    I take (1, 2) 15

    Then I can also take (2,1)75,(2,3)28,(3,2)70, which means that I can divide the matrix into two parts.

    To see which part of it is greater, I'll take that part.

    I should have misunderstood what the landlord meant.

    As you added.

    In this case, the idea of dp (dynamic programming) is used

    First of all, you must not be greedy, that is, always choose the biggest.

    This example will not pass.

    The specific dp is not so easy to say.

    State transitions are not something that can be explained in a few words.

    I'm really sorry...

    The landlord can go and learn about DP first

    Maybe you can figure it out yourself.

    I'm optimistic about you, oh 0

  3. Anonymous users2024-02-05

    It can be done with deep search, traversing each position, such as a[i][j], then the points that are not adjacent to it are a[i-1][j-1], a[i-1][j+1], a[i+1][j-1], a[i+1][j+1], a total of 4 points, and add them to the queue.

  4. Anonymous users2024-02-04

    1.The reason why the value does not change when compiling the executable image again is because the initial address of the stack selected by the system when loading the executable image is relatively fixed, A is on this stack, and the program starts to execute the main function, which is a step-by-step routine with no variables, so it is understandable that the address of A does not change.

    d",20000) is not difficult to understand, because the pointer is just an address value in the final analysis, and there is no difference between using the address value directly and using the pointer directly, at most the compiler will warn you.

    I don't know what you said: ""Define a function yourself, such as f(*pointer); Then in this way, the error "" is reported.

    See below**.

    #include

    int ge(int *p)

    int main()

    If you mean like the above, then this paragraph** I've tried, and there is no error, it works fine, and finally outputs 3

    Welcome to the continuation of the discussion.

  5. Anonymous users2024-02-03

    Each function has a stack, which is a contiguous piece of memory space, and &a gets the offset address of the variable relative to the top of the stack, so it is constant, so it is correct.

    If you define each function, then the function has its own stack, and when the function call is finished, the stack will be destroyed, so it is not right for you to define each new function

  6. Anonymous users2024-02-02

    You'll want to look at how to implement the scanf function. Its second argument is not a pointer (which can be understood as a variable).

  7. Anonymous users2024-02-01

    Those who watched and experienced it also learned about this interesting phenomenon and were taught

  8. Anonymous users2024-01-31

    The first thing to say is that this problem is contrary to the idea of programming - it is easy to calculate the average of n integers, and you don't even need arrays, but the problem requires not only arrays but also dynamic arrays, so it is not advisable to choose from near to far.

    Run example:

  9. Anonymous users2024-01-30

    #include

    #include

    int main()

    int *a,i,n,sum;

    while(1){

    sum=0;

    printf("Enter an integer:");

    scanf("%d",&n);

    if(n<1)return 0;

    a=(int *)malloc(n*sizeof(int));

    if(a==null) return 1;

    printf("Enter %d digits:",n);

    for(i=0;i

  10. Anonymous users2024-01-29

    a+=b;means a=a+b;

    That a=2+5=7.

    b-=c;i.e. b=b-c;

    That b = 5 - 6 = -1.

    c*=d;i.e. c=c*d;

    That c=6*10=60.

    d/=a;i.e. d = d a;

    That d = 10 7 = 1 (because 10 and 7 are both integers, what happens is divisible, and the decimal part is discarded).

    So, a=7, b=-1, c=60, d=1.

Related questions
7 answers2024-04-08

Be careful in the future, if you need to enter personal real information when you need to register information online, you must think more about whether it must be true, otherwise don't enter it randomly, or it may really fail, I have also suffered from this, but fortunately, the loss is not big! >>>More

25 answers2024-04-08

In fact, the most girls don't have to be "cheating" means. >>>More

6 answers2024-04-08

After all, you're in your third year of high school, and your studies are the priority!If she loves you, maybe she doesn't agree to talk to you for the sake of the better development you can work towards, and talk about it later?What you have to do is prove that you can give her happiness, in saying that you love her, and then talk about being together. >>>More

5 answers2024-04-08

It is necessary to pay attention to the characteristics of each subject and the connection between each subject, and to imagine and think more. >>>More

21 answers2024-04-08

Such a woman should stay away, it's not that she's bad! It's that he thinks too much!