hdu 2099 整数的尾数 http://acm.hdu.edu.cn/showproblem.php?pid=2099

#include<iostream>
using namespace std;

int main()
{
  int a,b;
  while(cin>>a>>b)
  {
    int tag=0;
    if(a==0&&b==0)  break;

    for(int i=0;i<=9;i++)
     for(int j=0;j<=9;j++)
        {
            int final=a*100;
           final+=i*10+j;
            if(final%b==0)
              {
                  if(tag==1)
                  cout<<" "<<i<<j;
                  else
                  cout<<i<<j;
                  tag=1;
              }

        }
    cout<<endl;
  }
}
// 水题一个  唯一要注意的是输出格式  把空格放在前面 否则会presentation error
原文地址:https://www.cnblogs.com/814jingqi/p/3217979.html