标签:style class blog c code java
#include<iostream> #include<algorithm> #include<stdio.h> #include<numeric> using namespace std; int bigswap(char* a,int start,int end) { while(start<end) { swap(a[start],a[end]); start++; end--; } return 1; } int helper(char* a,int m) { int len = strlen(a); bigswap(a,0,m); bigswap(a,m+1,len-1); bigswap(a,0,len-1); return 1; } int main() { char a[] = "123456789"; // char* a = "123456789"; 报错,是不是因为常量不可更改? helper(a,3); printf("%s",a); }
标签:style class blog c code java
原文地址:http://www.cnblogs.com/berkeleysong/p/3736493.html