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
posted @ 2013-07-03 14:41  814jingqi  阅读(114)  评论(0编辑  收藏  举报