Home > Back-end >  Strives for the big help
Strives for the big help

Time:11-18

With an integer n to n input variables, and then calculation and then output n variables how make

CodePudding user response:

What calculate?

CodePudding user response:

Dynamic application memory
For example

 int main () 
{
Int n, I, * a;
Printf (" please enter n: ");
The scanf (" % d ", & amp; n);
A=(int *) malloc (sizeof (int) * n);
Printf (" please input value of the variable n: ");
for (i=0; iThe scanf (" % d ", & amp; A [I]);
}
//processing, LZ add yourself

//print the results
for (i=0; iPrintf (" a [% d]=% d ", I, a [I]);
}

Free (a);
return 0;
}

  • Related