Skip to content

Latest commit

 

History

History
32 lines (30 loc) · 331 Bytes

90.md

File metadata and controls

32 lines (30 loc) · 331 Bytes

题目:读结果。

#include<stdio.h>
#include<stdlib.h>

#define M 5
int main()
{
	int a[M] = { 1,2,3,4,5 };
	int i, j, t;
	i = 0; j = M - 1;
	while (i < j)
	{
		t = *(a + i);
		*(a + i) = *(a + j);
		*(a + j) = t;
		i++; j--;
	}
	for (i = 0; i < M; i++) {
		printf("%d\n", *(a + i));
	}

}

结果:

5
4
3
2
1