建立一个类move,对数组中元素进行循环换位,即每一个元素后移三位,最后三个元素移到最前面。

[复制链接]
查看11 | 回复2 | 2012-3-5 15:18:22 | 显示全部楼层 |阅读模式
#include using namespace std;class move{ private:int array[20];int n; public:move(int b[], int m){
for(int i=0;i=0;i--){
array = array[i-1];
}
array[0] = temp;}void print(){...
回复

使用道具 举报

千问 | 2012-3-5 15:18:22 | 显示全部楼层
#include void MOVE(int *num,int n)//数组初始化{int i;printf("please input %d nums:",n);for(i=1;i<=n;i++)scanf("%d",&num);}void change(int *num,int n...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行