提交时间:2024-03-08 13:11:00
运行 ID: 136155
#include<bits/stdc++.h> using namespace std; const int N =1e5+10,INF =0x3f3f3f3f; int n; int main () { while(cin>>n && n!=0){ long long c=pow(2,n-1); if(n!=1)cout<<c%n+1<<endl; else cout<<0<<'\n'; } return 0; }