Data update
This commit is contained in:
parent
5150844a7d
commit
4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions
|
|
@ -7,12 +7,12 @@ public int double(int n) = n*2;
|
|||
public bool uneven(int n) = (n % 2) != 0);
|
||||
|
||||
public int ethiopianMul(int n, int m) {
|
||||
result = 0;
|
||||
while(n >= 1) {
|
||||
if(uneven(n))
|
||||
result += m;
|
||||
n = halve(n);
|
||||
m = double(m);
|
||||
}
|
||||
return result;
|
||||
result = 0;
|
||||
while(n >= 1) {
|
||||
if(uneven(n))
|
||||
result += m;
|
||||
n = halve(n);
|
||||
m = double(m);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue