c 循环左移
char b[11] = {'1', '2', '3', '4', '5', '6', '7', '8', '9', '0'}; const int iShift = 4; for (int j = 0; j < iShift; j++){//循环左移 char pTem = b[0]; for (int i = 0; i < strlen(b); i++){ if (i == strlen(b) - 1){ b[i] = pTem; } else{ b[i] = b[i + 1]; } } } printf("%s\n", b);
版权声明:本文为博主原创文章,未经博主允许不得转载。