Last active
June 24, 2020 11:35
-
-
Save ppajdek/d36b1e9f906fe961a5373e59031044a8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int calc(int[][] table, int id, int ds) { | |
int sum = 0; | |
for (int[] row : table) { | |
for (int i = 0; i < 7; i++) { | |
if (row[i] == id) { | |
sum += ds; | |
if (i == 6) sum += ds * 0.5; | |
} | |
} | |
} | |
return sum; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment