1、
#include <stdio.h>
int main(void)
{
int v[5];
v[0] = 1;
v[1] = 2;
v[2] = 3;
v[3] = 4;
v[4] = 5;
printf("v[0] = %d
", v[0]);
printf("v[1] = %d
", v[1]);
printf("v[2] = %d
", v[2]);
printf("v[3] = %d
", v[3]);
printf("v[4] = %d
", v[4]);
return 0;
}
↓
#include <stdio.h>
int main(void)
{
int v[5] = {1,2,3,4,5};
int i;
for (i = 0; i < 5; i ++)
printf("v[%d] = %d
", i, v[i]);
return 0;
}
↓
#include <stdio.h>
int main(void)
{
int v[5] = {666,333,111,1000,12345};
int i;
for (i = 0; i < 5; i ++)
printf("v[%d] = %d
", i, v[i]);
return 0;
}
↓
#include <stdio.h>
int main(void)
{
int v[] = {485,6546,500,600,333,5522,6211,84569};
int i;
for (i = 0; i < 8; i ++)
printf("v[%d] = %d
", i, v[i]);
return 0;
}