#include <iostream> using namespace std; void test1() { int a,x; for(a=0,x=0;a<=1&&!x++;a++) a++; cout<<a<<" "<<x<<endl; } void test2() { int a,x; for(a=0,x=0;a<=1&&!x++;) a++; cout<<a<<" "<<x<<endl; } int main() { test1(); test2(); return 0; }
输出结果:
2 1
1 2