整除的尾数:

#include<iostream>
#include<map>
using namespace std;
int main(){
    int a,b;
    map<int,int> m;
    typedef map<int,int>::value_type val;
    map<int,int>::iterator iter;
    while(cin>>a>>b){
        if(a==0&&b==0)
            break;
              
        int i,j;
        for(i=0;i<=9;++i){
            for(j=0;j<=9;++j){
                if((a*100+i*10+j)%b==0)
                    m.insert(val(i,j));
            }
        }
          
        int count=1;
        for(iter=m.begin();iter!=m.end();++iter){
            cout<<iter->first<<iter->second;
            if(count!=m.size())
                cout<<" ";
            count++;
        }
        cout<<endl;
        m.clear();
    }
      
    return 0;
}