659A Codeforces - Round House
Solution in c++
#include <bits/stdc++.h>
using namespace std;
int a,b,c;
int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);cout.tie(0);
    cin>>a>>b>>c;
    b+=c;
    while(b<=0)b+=a;
    if(b%a>0)b%=a;
    else if(b%a==0)b=a;
    cout<<b;
}
0 التعليقات:
إرسال تعليق