题意:1~n的环,从a走b步,会走到那个位置;b>0表示顺时针走,b<0表示逆时针走。
分析:水题~~
<span style="font-size:18px;">#include <iostream>
#include <cstdio>
#include <cstring>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <vector>
#include <cmath>
#include <algorithm>
using namespace std;
const double eps = 1e-6;
const double pi = acos(-1.0);
const int INF = 0x3f3f3f3f;
const int MOD = 1000000007;
#define ll long long
#define CL(a,b) memset(a,b,sizeof(a))
#define lson (i<<1)
#define rson ((i<<1)|1)
#define MAXN 100010
int main()
{
int n,a,b;
while(cin>>n>>a>>b)
{
int t;
if(b > 0)
t = (a+b%n)%n;
else
t = a-(-b)%n;
if(t <= 0)t=n+t;
printf("%d\n",t);
}
return 0;
}
</span>