Acwing周数题目链接:https://www.acwing.com/activity/content/problem/content/6864/
(1)看题目
(2)下面是C++代码
(3)解释:一共就6种情况,012,左换102,右换120,左换210,右换201,左换021 – 下一个右换 012; 所以是六个一循序
#includeusing namespace std; int main() { int n,x; cin >> n >> x; string str = "012"; int r = n % 6; for(int i = 1; i <= r; i ++) { if(i&1) // 相当于 i % 2 == 1; swap(str[0],str[1]); else // i % 2 == 0 swap(str[1],str[2]); } cout << str[x] << endl; return 0; }
打蓝桥杯,不如搞工程。



