Call for Problems

Question

Solution

Idea

This is the second ICPC-related question I have encountered, but to be honest, this one is a give-away question. Nothiing to talk about.

Code

https://github.com/mendax1234/Coding-Problems/blob/main/kattis/callforproblems/callforproblems.c
#include <stdio.h>

int main()
{
  int n;
  scanf("%d", &n);
  int num_odd = 0;
  for (int i = 0; i < n; i += 1)
  {
    int prob;
    scanf("%d", &prob);
    if (prob % 2 == 1)
    {
      num_odd += 1;
    }
  }
  printf("%d\n", num_odd);
}

Last updated