daily pastebin goal
50%
SHARE
TWEET

Untitled

a guest Sep 14th, 2018 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public int fixMyNumber3(int a){
  2.     int x = a/100;
  3.     int y = ((a%100)/10);
  4.     int z = a%10;
  5.    
  6.     if(x<3&&y<3){
  7.         return (x*200)+(y*20)+(z);
  8.     }
  9.     else if(x>3&&y<3&&z<3){
  10.         return ((x-1)*100)+(y*20)+(z*2);
  11.     }
  12.     else if(x>3&&y<3&&z>3){
  13.         return ((x-1)*100)+(y*20)+(z-1);
  14.     }
  15.     else if
  16.     else if(x>3&&y>3&&z>3){
  17.         return ((x-1)*100)+((y-1)*10)+(z-1);
  18.     }
  19.     return (x*100)+(y*10)+(z*1);
  20. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top