<span style= "font-family:arial, Helvetica, Sans-serif; Background-color:rgb (255, 255, 255); " > has a shape array A with 10 elements that require all elements in the output array </span>
Thinking: There are 3 ways to refer to the values of each element in the array: 1. Subscript method, such as a[3];2. Computes the address of an array element by array name, and finds the value of the element
3. Use the pointer variable to point to the array element.
Use pointer variable to point to array element # include <stdio.h>int main () { int a[10]; int i; int *p; printf ("Please enter 10 integers \ n"); for (i=0;i<10;i++) scanf ("%d", &a[i]); For (p=a;p< (a+10);p + +) printf ("%2d", *p); printf ("%\n"); return 0;} Computes the array element address by array name # include <stdio.h>int main () { int a[10]; int i; printf ("Please enter 10 integers \ n"); for (i=0;i<10;i++) scanf ("%d", &a[i]); for (i=0;i<10;i++) printf ("%2d", * (A+i)); printf ("%\n"); return 0;} Subscript method # include <stdio.h>int main () { int a[10]; int i; printf ("Please enter 10 integers \ n"); for (i=0;i<10;i++) scanf ("%d", &a[i]); for (i=0;i<10;i++) printf ("%2d", A[i]); printf ("%\n"); return 0;}
The C language has a shape array A with 10 elements that require all the elements in the output array