Блог пользователя LBcode

Автор LBcode, 11 лет назад, По-английски

the first thought coming in to my head, is that using if statement then make a decision.Something like:

int resultN = 0;
if(n%a !=0){
 resultN ++;
}
 resultN += n/a;

Then do the same thing to m.

Finally,multiply them.

result = resultN *resultM;

Here,I make two mistakes. 1)Didn't pay attention to the number range; 2)Use too many intermediate variables;

Hope code better next time. :D

  • Проголосовать: нравится
  • -16
  • Проголосовать: не нравится

»
11 лет назад, скрыть # |
← Rev. 2  
Проголосовать: нравится +4 Проголосовать: не нравится

Oh thanks! LOL..