Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- float array[] = new int[];
- int idx=0;
- int m(float x, float y){
- if(x%2!=0){
- array[idx]=y;
- idx=idx+1;
- }
- if(x==1)
- return y;
- x=math::floor(x/2);
- y=y*2;
- if(x!=1)
- return m(x,y);
- int temp=0;
- for(int i=0;i<idx;i++){
- temp=temp+array[i];
- }
- return(temp);
- }
Add Comment
Please, Sign In to add comment