Home > Back-end >  It's me again, I came again
It's me again, I came again

Time:09-23

First of all, ~, pointer really difficult!!!!!!
And this I think I know where I was wrong, but not how will change, thank you very much!!!!!!
Code:
#include
Int main () {
Int I, j, a [3] [3]={0}, * p * q;
Float business;
for(i=0; i<3; I++) {
for(j=0; j<3; J++) {
A [I] [j]=rand () % 100 + 0) - 50;
P=a, [I].
}
}
Printf (" randomly generated array is: \ n ");
for(i=0; i<3; I++)
for(j=0; j<3; J++) {
Printf (" % 5 d, "a [I] [j]);
If (j==2)
printf("\n");
}
for(i=0; i<3; I++) {
Q=a, [I].
Business=(* (p + I * 3 + 0) + * (p + I * 3 + 1) + * (p + I * 3 + 2))/(3);
Printf (" % d done for %. The average 3 f \ n ", I + 1, business);
}
return 0;
}

CodePudding user response:

Need to sign up for a class, ha ha??

CodePudding user response:

reference 1/f, Simple, Soft reply:
need to sign up for a class, ha ha?

Thank you, seems to be that way, I may really need to sign up for a class... On my own seemingly more to learn more about the...

CodePudding user response:

The p is meaningless, just q is ok

CodePudding user response:

Thank you, want to for a night, have to know how to change the

CodePudding user response:

 
#include

Int main ()
{
int i=0;
int j=0;
Int a [3] [3]={0};
Int * p=NULL;
Int * q=NULL;
Double business=0;

for (i=0; i <3; I++)
for (j=0; J & lt; 3; J++)
A [I] [j]=3 * I + j;

for (i=0; i <3; I++)
{
for (j=0; J & lt; 3; J++)
Printf (" \ t % d ", a [I] [j]);
printf("\n");
}

for (i=0; i <3; I++)
{
Business=(a [I] a [I] [0] + [1] + [I] [2] a)/(3);
Printf (" business line % d: % 3 f \ n ", I + 1, business);
}
printf("\n");

for (i=0; i <3; I++)
{
P=a, [I].
Business=(* (p + 0) (p + 1) + + * * (p + 2))/(3);
Printf (" business line % d: % 3 f \ n ", I + 1, business);
}
printf("\n");

for (i=0; i <3; I++)
{
Q=(int *) a;
Business=(
* (q + I * 3 + 0) +
* (q + I * 3 + 1) +
* (q + I * 3 + 2))/(3);
Printf (" business line % d: % 3 f \ n ", I + 1, business);
}

return 0;
}

CodePudding user response:

Business=(* q + * (+ + q) + * (+ + q))/3;

CodePudding user response:

I can teach you a pointer things,

CodePudding user response:

The
reference response: 7th floor thousand dream life
things I can teach you a pointer,

Different time, but no money,

CodePudding user response:

refer to the eighth floor response: thousand dreams life
Quote: reference response: 7th floor thousand dream life

I can teach you a pointer things,

Different time, but don't accept money,

I also in learning
  • Related