程序代码:
// Note:Your choice is C++ IDE
#include <iostream>
using namespace std;
void Fun(int N, int M)
{
int k = 0;
for(int i = 1; i <= N; i++)
{
k = (k + M)%i; //每次提走一个元素
}
cout<<k+1<<endl;
}
void Change(char a[], int b[], int n) //n为字符串长度
{
for(int i = 0; i != n-1; i++)
{
b[i] = (int)a[i]; //强制类型装换
cout<<a[i]<<" to "<<b[i]<<endl;
}
}
void Secret(char a[], char b[], int n, int N) //n为字符串长度,N为移动个数
{
for(int i = 0; i != n-1; i++)
{
if((a[i]>'a' && a[i]<='z'-N) || (a[i]>'A' && a[i]<='Z'-N)) //控制为字母
{
b[i] = a[i] + N;
}
if((a[i]<='z' && a[i]>'z'-N) || (a[i]<='Z' && a[i]>'Z'-N))
{
b[i] = a[i] + N - 32; //最后的N个字符往前N个字符换
}
}
}
void Menu()
{
int n;
cin>>n;
while(1)
{
switch(n)
{
case 1: 功能函数........break;
case 2:
.............
}
}
}