28 lines
482 B
C
28 lines
482 B
C
// 以下程序的输出结果是( )
|
||
// A)17 B)18 C)19 D)20
|
||
// main()
|
||
// {
|
||
// int a[] = {2, 4, 6, 8, 10}, y = 1, x = 0, *p = NULL;
|
||
// p = &a[1];
|
||
// for (; x < 3; x++)
|
||
// y += *(p + x);
|
||
// printf(“% d\n”, y);
|
||
// }
|
||
|
||
#include <stdio.h>
|
||
|
||
int main()
|
||
{
|
||
int a[] = {2, 4, 6, 8, 10},
|
||
y = 1,
|
||
x = 0,
|
||
*p = NULL;
|
||
|
||
p = &a[1];
|
||
for (; x < 3; x++)
|
||
y += *(p + x);
|
||
|
||
printf("%d\n", y);
|
||
|
||
return 0;
|
||
} |