OJ-Problems-Source/QUSTOJ/1372.cpp

15 lines
185 B
C++
Raw Normal View History

2016-07-06 10:15:29 +08:00
#include <cstdio>
int main()
{
int n;
scanf("%d",&n);
int f=0;
int m=3;
for(int i=1;i<=n;i++)
{
f=(f+m)%i;
}
printf("%d\n",f+1);
return 0;
}