Advertisement
juanjo12x

SRM_451_Div2_250

Aug 19th, 2014
249
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.19 KB | None | 0 0
  1. class ReverseMagicalSource {
  2. public:
  3.     int find(int source, int A) {
  4.       int aux=source;int tot=10;
  5.         while(aux<A){
  6.         aux=aux+(aux*tot);tot=tot*10;
  7.         }
  8.         return aux;
  9.     }    
  10. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement