|
|
вернуться в форумfew hints Don't update current x and y on each iteration. Save the total number of jumps of one direction. Ex: int toSouthWest = 0; for (int i = 0; i < a.legth; i++) { if (a[i] == '1'){ toSouthWest++; } if (a[i] == '9'){ toSouthWest--; } if (a[i] == '8'){ toSouth++ } ... } then you sum diractions vectors and get the answer double y = toSouth + (toSouthWest + toSouthEast)*(1/2)^(1/2); double x = ... good luck!! |
|
|