字符串循环移位
来源:互联网 发布:室内烧烤知乎 编辑:程序博客网 时间:2024/05/17 05:01
翻手法
#include<stdio.h>#include<stdlib.h>#include<string.h>/*reverse hand to do rotate right*/void reversehand(char *list, int low , int high){int tmp;while(low<high){tmp = list[low];list[low]=list[high];list[high]=tmp;low++;high--;}}int main(){char *list;int length,n;list = (char *)malloc(sizeof(char));strcpy(list,"abcdefghi");length = strlen(list);printf("how many steps you want to move to right rotate:\n");scanf("%d",&n);reversehand(list,0,length-n-1);reversehand(list,length-n,length-1);reversehand(list,0,length-1);printf("after right shifted %d step(s) the list is :%s\n",n,list);system("pause");return 0;}
0 0
- 字符串循环移位包含
- 读书笔记--字符串循环移位
- 字符串循环移位
- 字符串循环移位
- 字符串循环移位
- 字符串循环移位算法
- 字符串循环移位
- 字符串循环移位
- 字符串 --- 循环移位问题
- 字符串循环移位
- 字符串循环移位
- 字符串循环移位
- 字符串循环移位
- 字符串右循环移位
- 字符串右循环移位
- 字符串循环移位
- 字符串循环移位
- 字符串循环移位
- 匈牙利算法学习资料
- /bin/bash: line 0: fg: no job control一般解决方法
- android 工具类 DateUtil
- Construct Binary Tree from Inorder and Postorder Traversal
- 解决tomcat6.0启动一闪而过的方法
- 字符串循环移位
- POCO 的 Zip 类对中文文件名支持不正确的解决方法
- 三元组实现矩阵转置.cpp
- Android SQLite的 select 操作分析 .
- sql之表连接
- uvaLA 3695
- Linux运维第2天:Linux文件系统详解
- 垃圾收集器与内存分配策略
- 软考之路(八)--- 大总结