傻傻的胡桃
litachloveyou · · 个人记录
通过观察可以发现
所以只需要判断
#include<bits/stdc++.h>
using namespace std;
using i64 = long long;
int ans[] = { 1,3,9,7 };
void solve()
{
int n;
cin >> n;
cout << ans[n % 4] << "\n";
}
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
int t = 1;
cin >> t;
while (t--)solve();
return 0;
}