WeltEnSTurm

Untitled

Sep 30th, 2010
375
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.28 KB | None | 0 0
  1.  
  2. float array[] = new int[];
  3. int idx=0;
  4.  
  5. int m(float x, float y){
  6.     if(x%2!=0){
  7.         array[idx]=y;
  8.         idx=idx+1;
  9.     }
  10.     if(x==1)
  11.         return y;
  12.     x=math::floor(x/2);
  13.     y=y*2;
  14.     if(x!=1)
  15.         return m(x,y);
  16.     int temp=0;
  17.     for(int i=0;i<idx;i++){
  18.         temp=temp+array[i];
  19.     }
  20.     return(temp);
  21. }
Add Comment
Please, Sign In to add comment