[ create a new paste ] login | about

Link: http://codepad.org/G8OJVoj9    [ raw code | output | fork ]

C++, pasted on Jul 1:
1
2
3
4
5
6
7
8
9
10
11
#include <iostream>
#include <algorithm>

int main() {
  int arr[] = { 2, 4, 5, 6, 7, 8, 9, 10, 4 };

  std::cout << "Сумма " 
            << (std::accumulate(arr, arr + sizeof(arr) / sizeof(arr[0]), 0) % 2 == 0? "четная" : "нечетная")
            << std::endl;
  return 0;
}


Output:
1
Сумма нечетная


Create a new paste based on this one


Comments: