#include <stdio.h> int main( void ) { for( unsigned n; scanf("%u",&n)==1; ) { unsigned f = 0; for( unsigned i=1; i<=n; ++i ) f = (f+2)%i; printf( "%u\n", f+1 ); } return 0; }
scanf("%d", &loop); count = 0; j = loop; for (i = 0; j > 0; i++) { j = j / 2; count++; } printf("最后编号:%d\n", (int)(2 * (loop - (pow(2, count - 1))) + 1));