标签:c语言学习
#include<stdio.h> void reverse(const int *start,const int *end) { int *tstart = start; while (start != end) { int *left = tstart; while (left != end) { if (*left > *(left + 1)) { *left = *left^*(left + 1); *(left + 1) = *left^*(left + 1); *left = *left ^ *(left + 1); left++; } else left++; } start++; } } int main() { int a[] = { 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 }; int len = sizeof(a) / sizeof(a[0]); reverse(a, a + len - 1); system("pause"); return 0; }
标签:c语言学习
原文地址:http://lzd1995.blog.51cto.com/10973198/1735480