Skip to content

Instantly share code, notes, and snippets.

@ppajdek
Last active June 24, 2020 11:35
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ppajdek/d36b1e9f906fe961a5373e59031044a8 to your computer and use it in GitHub Desktop.
Save ppajdek/d36b1e9f906fe961a5373e59031044a8 to your computer and use it in GitHub Desktop.
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