WA #1 #2 #9 #10,60pts求条
查看原帖
WA #1 #2 #9 #10,60pts求条
637410
sqrt404楼主2024/10/28 16:06
#include <iostream>
using namespace std;
int t, n, book[] = {-1, -1, 1, 7, 4, 2, 6, 8, 10, 18, 22, 20, 28, 68, 88};
int main()
{
	cin >> t;
	while(t--)
	{
		cin >> n;
		if(n <= 14) cout << book[n] << endl;
		else
		{
			cout << book[(n - 14) % 7 + 7];
			for(int i = 1; i <= (n - 14) / 7 + 1; i++) cout << 8;
			cout << endl;
		}
	}
	return 0;
}
2024/10/28 16:06
加载中...