C language homework, the master comes quickly, the high score is given to you, speed

Updated on technology 2024-05-19
7 answers
  1. Anonymous users2024-02-11

    #include

    void find(int *a,int k,int x) a is the array name, k is the array size, and x is the element to be found.

    int counter1=0;

    for(int i=0;i<=k;i++)if(a[i]==x)

    Cout <, then replace Cin with Scanf, Cout with PrintF, and you're almost done!

  2. Anonymous users2024-02-10

    Answer: A Error correction.

    int p;

    scanf("%d",&p);

    int *p,a;

    p=&a;scanf("%d",p);

    Both of the above are fine.

    Analysis: The compiler does not initialize the "local variable", the global variable is initialized to 0

    Answer A cannot be used because it is not initialized before using the pointer variable p.

    2.Answer B Error correction.

    int *s,k;

    s=&k;*s=100;

    Pass a, both are pointers that are not initialized before use.

    3.Answer C is correct.

    4.Answer d is incorrect.

    s=p;is wrong.

    This is because s is an integer pointer and p is a character pointer. Two variables with different pointer types cannot be assigned.

    I hope mine was helpful to you and it was a pleasure to learn and discuss C programming with you.

  3. Anonymous users2024-02-09

    The pointers of A and B are null pointers, and D cannot be implicitly converted in C++, and an error will be reported.

  4. Anonymous users2024-02-08

    CD is fine, AB is used without allocating memory.

  5. Anonymous users2024-02-07

    Only C should be correct, and the last 2 lines of D have memory out-of-bounds issues.

  6. Anonymous users2024-02-06

    In fact, no matter what kind of situation it is, according to the latitude and longitude, you can find the central angle of a and b, then the ground distance between the two is actually the arc length, assuming that the central angle is x (how to find it, I don't know, hehe).

    #include

    define pi

    main()

    double l,x,r;

    r = 6371;Unit: km.

    l = x * r;x is calculated based on latitude and longitude.

    printf("%lf",l);

  7. Anonymous users2024-02-05

    If you do the math, you can ask for it.

Related questions
6 answers2024-05-19

#include

void main() >>>More

4 answers2024-05-19

Your QQ is not in your C disk,Your Thunderbolt is not in your C disk,Is your other software also there?,I think the software you said doesn't install the C disk refers to the game, right,If you have QQ Thunderbolt,** These things,That also takes up space,Exceptions don't know what you use to clean up garbage,Clean up with good garbage cleaning software,These you have done,That is, your machine is poisoned,Occupy memory space,Occupy your system space,If that's the case,Then you'd better start from the system, Or you can't clean it up, buddy.

11 answers2024-05-19

I feel very simple...

#include >>>More

5 answers2024-05-19

Define an array of scores to record scores, record rankings and score bins. >>>More