Правильный ответ это В.
int sum = 0, n = 0;
cin >> n;
int arr[n];
for (int i = 0; i < n; i++){ cin >> arr[i];
sum+=arr[i];