提交时间:2024-01-25 08:05:24

运行 ID: 127148

#include <bits/stdc++.h> using namespace std; int main() { long long n; while(cin >> n && n != 0) { if(n == 1) cout << 0 << endl; long long num = pow(2,n - 1); cout << num % n + 1 << endl; } }