循环字符串
来源:互联网 发布:淄博网络推广 编辑:程序博客网 时间:2024/05/29 11:08
#include "stdafx.h"
#include<iostream>
using namespace std;
void LoopMove(char *pStr,int steps)
{
int n=strlen(pStr)-steps;
cout<<n<<endl;
char temp[127];
memcpy(temp,pStr+n,steps);
memcpy(temp+steps,pStr,n);
*(temp+steps+n)='\0';
strcpy(pStr,temp);
cout<<temp<<endl;
}
int _tmain(int argc, _TCHAR* argv[])
{
char pStr[100]="abcdefghi";
int steps=2;
LoopMove(pStr,steps);
cout<<pStr<<endl;
return 0;
}
#include<iostream>
using namespace std;
void LoopMove(char *pStr,int steps)
{
int n=strlen(pStr)-steps;
cout<<n<<endl;
char temp[127];
memcpy(temp,pStr+n,steps);
memcpy(temp+steps,pStr,n);
*(temp+steps+n)='\0';
strcpy(pStr,temp);
cout<<temp<<endl;
}
int _tmain(int argc, _TCHAR* argv[])
{
char pStr[100]="abcdefghi";
int steps=2;
LoopMove(pStr,steps);
cout<<pStr<<endl;
return 0;
}
- 循环字符串
- 字符串,循环
- 循环分割字符串
- 字符串循环插入
- 字符串循环左移
- 字符串循环右移
- 循环移动字符串
- 字符串循环移动
- 字符串循环移动
- 字符串循环移位包含
- 读书笔记--字符串循环移位
- 字符串循环移位
- 循环左移字符串
- 字符串循环移位
- [MSSQL]循环遍历字符串
- 字符串循环移位
- 不用循环反转字符串
- php 循环分割字符串,
- 迄今见过的最好的职业规划的文章
- jQuery.validate 用法
- svn报错
- 完成变量(一种简单的信号量)
- DFS 题目1114:神奇的口袋
- 循环字符串
- MySQL 生成随机密码 笔记
- 辞职后五险一金怎么处理?收藏下来吧~
- HDOJ 1712 ACboy needs your help(分组0/1背包)
- hdu2473之并查集
- ORACLE的几个函数在MYSQL里面的简单实现 笔记
- 不得不说的处女面
- Web服务器性能/压力测试工具http_load、webbench、ab、Siege使用教程
- 获取applicationContext的几种方式