You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
900 B

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#include <iostream>
using namespace std;
int main()
{
char ch[26],l,r;
int w,i,k,j;
cin>>i>>j>>w;
l=i+'a'-1; //把数字转换成字母
r=j+'a'-1;
cin>>ch;
for(i=1;i<=5;i++)
{
j=w-1; //从'个位'开始加
cout<<"从'个位'开始加 i的数值"<<i<<endl;
//------------------------------------------------重
while(j>=0&&ch[j]==r+j+1-w)
{
printf("%c ",r+j+1-w);
cout<<ch[j]<<" "<<"ttt这个时候的j"<<j<<" 这个时候的ch"<<ch<<endl;
j--; //找到当前为了把数变大,所必须进的位最小在哪
}
if(j==-1)
break;
//------------------------------------------------点
cout<<"yuanlai"<<ch[j];
ch[j]++; //进位
cout<<"升级进位变成:"<<ch[j]<<endl;
for (k=j+1;k<=w-1;k++)
ch[k]=ch[k-1]+1; //所需进位之后的所有位都需变大
cout<<ch<<endl;
}
return 0;
}
/*
备注数字中是1<2<3<4...
而Jam数中则是a>b>c>d...
*/