1.#
点击查看考点
生命期
1#include <iostream>
2
3using namespace std;
4
5int mys(int a[], int n) {
6 static int x = 0;
7 int b = a[n] / 3;
8 x += b;
9 return x % 4;
10}
11
12int main() {
13 int a[] = {0, 1, 4, 5};
14 for (int i = 0; i < 4; i++) {
15 cout << mys(a, i) << endl;
16 }
17 return 0;
18}