题目大意:输入m,求出最小的由0和1组成的数字,数字对m取余为0,水题
#include<stdio.h>
#include<string.h>
#include<math.h>
#include <queue>
#include <iostream>
#include<algorithm>
using namespace std;
queue<int> Q;
int main()
{
int n,temp;
scanf("%d",&n);
Q.push(1);
while (!Q.empty())
{
temp=Q.front();
Q.pop();
if (temp%n==0)
{
printf("%d\n",temp);
return 0;
}
temp=temp*10;
Q.push(temp);
temp=temp+1;
Q.push(temp);
}
return 0;
}