Advertisement
noshin98

uva 11805

Jul 5th, 2016
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.36 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {
  4.     int t,j,n,k,p,ans;
  5.     while(scanf("%d",&t)==1)
  6.     {
  7.         for(j=1;j<=t;j++)
  8.         {
  9.             scanf("%d%d%d",&n,&k,&p);
  10.             ans=k+p;
  11.             while(ans>n)
  12.             {
  13.  
  14.                 ans=ans-n;
  15.  
  16.             }
  17.             printf("Case %d: %d\n",j,ans);
  18.         }
  19.  
  20.     }
  21.     return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement