int RussianMul(int n, int m){int remain = 0;while(n != 1){// oddif (n % 2 != 0){n = (n-1)/2;remain += m;m *= 2;}// evenelse{n /= 2;m *= 2;}}return m + remain;}
Powered by: C++博客 Copyright © Condor