CodeForces

//可谓是非常水的题了,没什么可说的
#include <bits/stdc++.h>
using namespace std;
int main()
{
	int k, r;
	while (cin >> k >> r)
	{
		int i = 1;
		for (i = 1; ;i++)
		{
			int tp = i * k % 10;
			if (tp == 0 || tp == r)
			break;
		}
		cout << i << endl;
	}
	return 0;
}

原文地址:https://www.cnblogs.com/mofushaohua/p/7789525.html