#include using namespace std;int main() {\tint a[6] = {1, 2, 3, 4, 5, 6}; \tint pi = 0;\tint pj = 5; \tint t , i;\twhile (pi < pj) {\t\tt = a[pi]; \t\ta[pi] = a[pj]; \t\ta[pj] = t; \t\tpi ;\t\tpj--;\t}\tfor (i = 0; i < 6; i ) \tcout << a[i] << ",";\tcout << endl; \treturn 0;}
输出:
发表评论 取消回复