请指教。我的解答
#include "stdafx.h"
#include
using namespace std;
void transform(char* ,char* ,int ,int,int );
int _tmain(int argc, _TCHAR* argv[])
{
char b[100];
char a[100];
cin.getline(a,100);
int length;
for( length=0;length<100;length++)
if(a[length]=='\0')
break;
transform( a, b, length,0,0);
return 0;
}
void transform(char* a,char* b,int length,int loca,int locb)
{
char x,y[2];
x=*(a+loca);
*(b+locb)=static_cast(atoi(&x)+97);
if (loca==(length -1))
{*(b+locb+1)='\0';
cout <return;
}
else if(locatransform(a,b,length,loca+1,locb+1);
y[0]=*(a+loca);
y[1]=*(a+loca+1);
if(atoi(y)<26)
{
*(b+locb)=static_cast(atoi(y)+97);
if (loca==(length -2))
{
*(b+locb+1)='\0';
cout <return;
}
else if(locatransform(a,b,length,loca+2,locb+1);
}
}