1 2 3 4 5 6 7 8 9 10 11 12 | #include<cstdio> using namespace std; int main(){ int a[2]; //使用cur作下标表示,使用 ^位运算,比使用 %取模运算更快 int cur = 1; while (expression){ //do something a[cur] = ???; cur ^= 1; } return 0; } |
原文:http://www.cnblogs.com/qhy285571052/p/5180662.html