如图如代码,不过还是有限的,数字太过庞大,a会出现乱码。
#include<iostream>
#include<cmath>
using namespace std;
int main(){
int n;
cin>>n;
for(int j=1;j<=9;j++){
int a,b,c,m;
a=pow(10,j);
if(a%10!=0){
a=a+1;
}
int i;
b=n%a;
c=a/10;
m=b/c;
if(n%a!=0&&c<=n){
cout<<"a:"<<a<<" j:"<<j<<" m:"<<m<<" "<<endl;
}
cout<<" "<<endl;
}
return 0;
}
`