Tuesday, August 30, 2016

Codeforces[div.2-659]-A. Round House

#include <stdio.h>
#include <math.h>
int main()
{
    int n, a, b, r, d;
    while(scanf("%d%d%d", &n, &a, &b)==3)
    {
 d  = (a+b)%n;
 if(d<0)d+=n;
 if(d==0)d=n;
  printf("%d\n",d);
    }
    return 0;
}

No comments: