Ask the C master to help me see the errors in my program. And help me correct it. Thank you

Updated on Financial 2024-02-09
12 answers
  1. Anonymous users2024-02-05

    When passing in array parameters, int a[m][m] is used, where m cannot be a variable.

    The M-value has not changed in the landlord's program.

    You can put it. int m=10;

    Instead. #define m 10

    That's it.

  2. Anonymous users2024-02-04

    An array as a function argument is just quite a pointer, and your parameter is just a pointer to a two-digit array and not an array.

    You can change it like this, and I'm just going to write it roughly, right, and you can compile it.

    bool isself(int **a, int m)return true;}

  3. Anonymous users2024-02-03

    #include

    using namespace std;

    int m=10;

    int n,i,j,k,x;

    bool isself(int a[10][10])return true;}

    bool issym(int a[10][10])return true;}

    bool istran(int t[10][10],int a[10][10])

    return true;}

    int main()

    int x[10]=;

    int a[10][10];

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

    for(j=0;j<10;j++)

    cin>>a[i][j];

    int t[10][10]=;

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

    for(j=0;j<10;j++)

    cout<<"r is the equivalence relation"for(i=0;i<10;i++)

    cout<<"The equivalent class is:"else cout<<"r is not an equivalence relation"

  4. Anonymous users2024-02-02

    Changed it. #include

    using namespace std;

    const int m=10;The array length cannot be defined dynamically, it must be a constant here.

    int n,i,j,k,x;

    bool isself(int a[m][m]);

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

    for(j=0;j<10;j++)

    cout<<"r is the equivalence relation"for(i=0;i<10;i++)

    cout<<"The equivalent class is:"else cout<<"r is not an equivalence relation"

  5. Anonymous users2024-02-01

    You have a few mistakes in a few places:

    1.To find the single digit, you can directly use n%10, and you can find the value of the highest digit 2Now that you've set a single digit of 7, you can just assign a 7 to M.

    3.When you do the above calculation, when you finally exit the first while loop, n is 0, and you can't use this n to calculate below, if you keep using n = 10, you should use a variable to save the value of this n at the beginning.

    4.Also, in main, you can't just keep b a==t, because when the whole is out, if it is not divisible, it will be rounded.

    5.In fact, the best way to solve this problem is that you use mathematical deduction to calculate, and you can deduce it yourself, without exhaustive enumeration.

    #include

    using namespace std;

    int change(int n)

    Move the single digit to the highest digit.

    int q = m + p;The final number return q is obtained;

    int main()

    if (!find)

    cout <<"no"

  6. Anonymous users2024-01-31

    #include

    using namespace std;

    int change(int n) moves the single digit to the highest bit, int q=m+p; The resulting number cout<>t) is obtained

    if(!find)cout<<"no"<}return 0;}

  7. Anonymous users2024-01-30

    You change the value of n in the loop. Try this:

    int change(int n) moves the single digit to the highest bit, int q=m+p; The final number return q is obtained; }

  8. Anonymous users2024-01-29

    a+=a-=a*a;

    You can decompose it into, a=a-(a*a); After this is executed, a=-6;

    a=a+a;Note that here, a is not 3+ (6) is, (-6) + (6) and finally a = -12

    The array length is 16 bytes, because, the "" symbol contains a string, and it will automatically add one for you'\0'As the end string, so there are 16 in total, this question does not understand the meaning, condition, 2 and the symbol in C is && or the symbol is ||The combination is the last question of 2, and the first floor is very clear, so I won't repeat it!

  9. Anonymous users2024-01-28

    3:-12

    The length of a 4:17 string is the length of the content plus a bit 05:void main().

    or void main().

    6:if(x>2&&x<5||x<-18)1:void main()

  10. Anonymous users2024-01-27

    3. a=-3, calculated from right to left.

    4. The length of the array is 16, and a character should be added at the end'\0', indicating that the string ends 5 and does not understand the meaning of the question???

    6、if(2

  11. Anonymous users2024-01-26

    3. a=-12, count from right to left.

    4. The length of the array is 16, and the characters are added last'\0'The length of the string is 5

    6、if(2

  12. Anonymous users2024-01-25

    1、 a= ; y=2;+ and * are the same priority, combined from right to left, y = (*p)--The execution process of this statement is: p starts to point to a[0], p points to a[1], p) is the value of a[1], y is equal to 2, and then the value of a[1]--, so a[1] becomes 1.

    2. Option A y = 2; b option y = 2; Option c ++p is not written correctly option d = 3; Or the priority of ++ and * is considered well, as well as the operation method of ++, read the book, no typing.

Related questions
7 answers2024-02-09

The PD 925 (boxed) you said is only about 750 yuan, and the E6300 (boxed) is about 1280 yuan. How much does it cost to see how much it costs? If you're doing interior design, of course the CPU is a little better, and the graphics card is a little better. >>>More

14 answers2024-02-09

It's good, you don't need to change it, what are you for?

7 answers2024-02-09

Out of the circle problem, this question is more classic, but at the same time slow and difficult, I have seen an algorithm, but the efficiency is not very high, and I haven't come up with it myself. >>>More

16 answers2024-02-09

Is the monitor AOC? Are you sure it's 24? 24's is not cheap. >>>More

26 answers2024-02-09

LZ hello is like this.

The elves of the Sail are mutual. >>>More