Advertisement
Guest User

Untitled

a guest
Sep 16th, 2019
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {
  4. int n, a, b, c, d, e, sum, count, i ,j, holder;
  5. scanf("%d", &n);
  6. for(i=1; i<=n; i++){
  7. scanf("%d %d %d", &a, &b, &c);
  8. holder = b;
  9. for(j=0; j<c; j++){
  10. holder++;
  11. }
  12. if(holder>a){
  13. holder = holder % a;
  14. printf("%d\n", holder);
  15. }
  16. else{
  17. printf("%d\n", holder);
  18. }
  19.  
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement