A C experiment, I don t know what the problem is, let s help

Updated on society 2024-04-09
12 answers
  1. Anonymous users2024-02-07

    while(j<=i) is an endless loop.

    int j=0 should be j=1

    insert(sqlist,q,3,9) should be insert(sqlist,sqlist,3,9).

    Because for(; p!=null;p=p->next)

    printf("%d ",p->data);

    After doing the math, p=null

    The correction is as follows:

    #include

    #include

    struct sq

    int data;

    struct sq *next;

    struct sq * insert(struct sq *head,struct sq *p,int i,int e)

    struct sq *p1,*p2;

    int j=1;

    p2=(struct sq*)malloc(sizeof(struct sq));

    p2->data=e;

    p1=head;

    while(j++<=i)

    p=p->next;

    p2->next=p->next;p->next=p2;

    return(head);

    int main()

    struct sq * insert(struct sq *head,struct sq *p,int i,int e);

    struct sq a,b,c,d,*sqlist,*p;

    sqlist=&a;

    ;;p=sqlist;

    printf("The raw data is: ");

    for(;p!=null;p=p->next)

    printf("%d ",p->data);

    printf("");

    printf("Insert a linked list after 4 between 5 and 9. n");

    insert(sqlist,sqlist,3,9);

    for(p=sqlist;p->next!=null;p=p->next)

    printf("%d",p->data);

    return 0;

  2. Anonymous users2024-02-06

    insert function definition.

    while loop.

    while(jnext;

    j++;Notice the boundaries of the lower loop. There is also a problem with the last output function, which does not output the last node.

  3. Anonymous users2024-02-05

    If you look closely, it seems that there are a lot of mistakes!

    3, ba = a + 7;Because it has a semicolon, it is a statement, not an expression.

    a=7+b+c, a++ is a comma expression.

    4,cint a[2][3]=,,} is one dimension less, a[3][3] is right.

    6,bint a=b=0;b is not defined and cannot be used to define a12, c

    This is how function pointers are defined.

    13,A This is simple and should not go wrong.

    15,afopen The first argument is const char*

  4. Anonymous users2024-02-04

    My answer is aabcaaddbcddadc, mine may also be wrong, FYI.

  5. Anonymous users2024-02-03

    The third question is wrong, the title says "expressions that conform to the grammar of the C language", and A is a statement, not an expression.

    It should be the fourth question of B, you should choose C, it is estimated that you chose the wrong question sloppily, do not explain the sixth question, you should choose B, C can not be declared like this, unless you have previously stated B Question 12, you should choose C, there is no reason.

    Question 13, there is nothing to explain,!A is equivalent to A==0 Question 15, and A should be chosen

  6. Anonymous users2024-02-02

    2. a

    3.b should be a is a statement, it has; Therefore it is not an expression, if it is not; Then A satisfies the topic.

    4 .c A curly brace is a line, and it has 3 curly braces, that is, it assigns a value of 3 lines greater than the specified number of lines 2, so D is wrong.

    6. b13. a

    15.aThe other answers are correct.

  7. Anonymous users2024-02-01

    Your question 4 is wrong, it should be c; Question 13 should be A

  8. Anonymous users2024-01-31

    1. Error reason, variable name cannot be a number.

    2. d=, c=

    3. a=4,b=4,c=2,d=2,i=3,j=4,m=3,n=24. a=-32

  9. Anonymous users2024-01-30

    Item B is incorrect.

    int a=1;

    dowhile(a<=10)

    The while() of do-while should be followed by a semicolon and a ......Most statements end with a semicolon and include the definition of the class.

  10. Anonymous users2024-01-29

    b Not true.

    dowhile(..

    The last semicolon is missing.

  11. Anonymous users2024-01-28

    b is not right, there is no semicolon at the end.

  12. Anonymous users2024-01-27

    b is incorrect, and a semicolon is missing from the last line";"

Related questions
20 answers2024-04-09

To be precise, it's not superpowers or magic.,The water behind the right seat of the god mentioned the clues of the fantasy killer in the fourteen volumes.,From his words, it can be inferred that the right hand of the upper strip is related to the ultimate purpose of the right seat of the god.,And the fourteenth volume also mentions the concept of the god.,The pronunciation of the god is the same as that of the upper one.,And then when he fought against the alchemist before,The right hand of the upper strip was broken.,Out of it is the head of the dragon king.,And the last party of the fifteen volumes passed the note they got with the English word "dragon", And the ability of the right side of the fire (note the right side of the name) that has the same power as the previous one in the 20 volumes, and the explosion of hemp at the end. From all of the above, it can be inferred that the power of the right hand may be the original sin, and that if the power is perfect, it can become God. Of course, this is still just speculation, let's see how the hippo is going to write.

35 answers2024-04-09

Is this love fraternity, or love? I didn't get it. What about my advice, live up to the people who love you, pay attention to details, and give love. >>>More

6 answers2024-04-09

Starfire is quite common, isn't it? You can see the grade 4 past exam papers published by Shanghai Jiao Tong University. General words are the basics, and then exam skills are added. You can take a look at the skills on the Internet, there are many **, mainly to see if you can fit it. Come on.

11 answers2024-04-09

If you get a virus, just go online and kill it.

10 answers2024-04-09

I'm a girl, go on your own, she'll be so impressed. But if you still want to buy a gift, you can ask her friend what he likes. Dolls and flowers are fine.