Skip to content

Instantly share code, notes, and snippets.

@lll-phill-lll
Created September 24, 2023 19:53
Show Gist options
  • Save lll-phill-lll/0dfe4282085ed91f1338488bb6fa0477 to your computer and use it in GitHub Desktop.
Save lll-phill-lll/0dfe4282085ed91f1338488bb6fa0477 to your computer and use it in GitHub Desktop.
sm02-3 main
#include <stdio.h>
// Пример, чтобы убедиться, что invoke работает
// int invoke(int16_t *arr, int size, int pivot) {
// int sum = 0;
// for (int i = 0; i != size; ++i) {
// sum += arr[i];
// }
//
// return sum;
// }
int invoke(int16_t *arr, int size, int pivot);
int main() {
int16_t arr[100];
int size, pivot;
scanf("%d%d", &size, &pivot);
for (int i = 0; i != size; ++i) {
scanf("%hd", &arr[i]);
}
int res = invoke(arr, size, pivot);
printf("%d\n", res);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment