Advertisement
juanjo12x

UVA_11547_Automatic_Answer

May 24th, 2014
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.52 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main(int argc, char** argv) {
  5.     int t,rest,coc;
  6.     int n;
  7.     scanf("%d",&t);
  8.     while(t--){
  9.         scanf("%d",&n);
  10.        
  11.         n=n*567;
  12.         n=n/9;
  13.         n=n+7492;
  14.         n=n*235;
  15.         n=n/47;
  16.         n=n-498;
  17.         int i=0;
  18.         while(i<2){
  19.             coc=n/10;
  20.             rest=n%10;
  21.             n=coc;
  22.             i++;
  23.         }
  24.         if(rest<0) rest=0-rest;
  25.         printf("%d\n",rest);
  26.        
  27.     }
  28.     return (EXIT_SUCCESS);
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement