⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 d.cpp

📁 The 5th Annual Shantou Univ.Collegiage Programming Contest
💻 CPP
字号:
#include <iostream>
#include <fstream>

using namespace std;

int main()
{
	ifstream input_file;
	input_file.open("Ray's Problem's input.txt");
	ofstream output_file;
	output_file.open("Ray's Problem's output.txt");
	int x[10][10]=
	{{1, 0},
	 {1, 1},
 	 {4, 2, 4, 8, 6},
	 {4, 3, 9, 7, 1},
	 {2, 4, 6},
	 {1, 5},
	 {1, 6},
	 {4, 7, 9, 3, 1},
	 {4, 8, 4, 2, 6},
	 {2, 9, 1}};
	int n, a, b;
	input_file >> n;
	while (n--)
	{
		int a, b;
		input_file >> a >> b;
		if (b==0)
			output_file << 1 << endl;
		else
		{
			a%=10;
			b%=x[a][0];
			if (b==0)
				output_file << x[a][x[a][0]] << endl;
			else output_file << x[a][b] << endl;
		}
	}
	input_file.close();
	output_file.close();
	return 0;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -