【水】HDU 2099——整除的尾数

来源:点击打开链接

数据范围小,枚举水过就行了……不过要注意格式!

 

#include <iostream>
#include <cstring>
#include <iomanip>
#include <cmath>
using namespace std;
int ans[100];
int main()
{
	int a,b;
	while(cin>>a>>b)
	{
		memset(ans,0,sizeof(ans));
		if(a==0 && b==0)
			break;
		a=a*100;
		int counter=0;
		for(int i=0;i<=99;i++)
		{
			if((a+i)%b==0)
			{
				ans[counter++]=i;
			}
		}
		for(int j=0;j<counter-1;j++)
		{
			cout<<setw(2)<<setfill('0')<<ans[j]<<" ";
		}
		cout<<setw(2)<<setfill('0')<<ans[counter-1]<<endl;
		
	}
	return 0;
}


 


 

posted @ 2013-09-10 21:14  pangbangb  阅读(194)  评论(0编辑  收藏  举报