Anonymous user
Ethiopian multiplication: Difference between revisions
m
→{{header|Java}}: No need to loop twice, and the table is still saved in the map if you want to debug later
(Added Object Pascal) |
m (→{{header|Java}}: No need to loop twice, and the table is still saved in the map if you want to debug later) |
||
Line 1,086:
Map<Integer, Integer> columns = new HashMap<Integer, Integer>();
columns.put(first, second);
int sum = isEven(first)? 0 : second;
do{
first = halveInt(first);
second = doubleInt(second);
columns.put(first, second);
▲ int sum = 0;
▲ if(!isEven(entry.getKey())){
}
}while(first != 1);
System.out.println(sum);
}
|