www
dddd
int vec_rotate(char *vec,int rotdist, int length) {
int i,j,k,times;
char t;
times = gcd(rotdist,length);
printf("%d\n",times);
for(i=;i<times;i++) {
t = vec[i];
j = i;
while() {
k = j+ rotdist;
if(k>=length)
k-=length;
if(k==i)
break;
vec[j] = vec[k];
j = k;
}
vec[j]=t;
}
return ;
}
向量左旋算法1:"杂技"代码
eee
随机推荐
- WPF、WinForm(C#)多线程编程并更新界面(UI)(转载积累)
using System;using System.Collections.Generic;using System.ComponentModel;using System.Drawing;using ...
- Html5 学习之 Html5功能判断插件 Modernizr
---恢复内容开始--- Modernizr 浏览器对HTML5和CSS3开发的功能检测类库 由于当前用户使用的浏览器版本较多,对H5和CSS3的支持也各不相同.前端的开发者,在使用一些新的特性的时候 ...
- django settings最佳配置
# encoding=utf-8 import os import socket SITE_ID = 1 # 项目的根目录 # 简化后面的操作 PROJECT_ROOT = os.path.dirna ...
- Robot Framework自动化测试环境的搭建
1.python-2.7.6.amd64.1394777203.msi 2.setuptools-28.0.0 3.pip-8.1.1 4.robotframework-2.8.7.win-amd64 ...
- chord原理的解读
chord: A Scalable Peer-to-peer Lookup Service for Internet Application 在 P2P 系统中,有效地定位分布在网络中不同节点的数据资 ...
- 将主机IDS OSSEC日志文件存入MYSQL的方法
将主机IDS OSSEC日志文件存入MYSQL的方法 http://www.freebuf.com/articles/system/6139.html http://ossec-docs.readth ...
- GO的数组及切片
感觉在向PYTHON学一些数组方面的功能. package main import "fmt" func main() { ]], , , , , , , , , } ] fmt. ...
- 超强Altium Designer焊盘为梅花状连接,过孔为直接连接的方法
AltiumDesigner6焊盘为梅花(或十字)状连接,过孔为直接连接的方法: 一.完成后效果 二.PCB规则设置(PCBRULES) 三.添加IsVia+ 四.添加InNamedPolygon() ...
- Delphi 把字符串读到流中的操作。
var FReQuestM := TMemoryStream FReQuestM.Write(PChar(FcVoucherXML)^, Length(FcVoucherXML)); 这样就读到流中了 ...
- win10 iis 创建新站点注意事项
新建站点时:注意文件夹权限增加everyone. 快速打开IIS:win+r:inetmgr