Дано 40 чисел, определите сколько из них отличны от последнего числа — C++(Си)

#include <iostream>
using namespace std;
int main()
{
    int i, count;
    const int n = 40;
    count = 0;
    int a [n];
    for (i = 0; i < n; i++)
        cin >> a [i];
    for (i = 0; i < n - 1; i++)
        if (a [i] != a [n - 1])
            count++;
    cout << count << endl;
    return 0;
}

2 Thoughts to “Дано 40 чисел, определите сколько из них отличны от последнего числа — C++(Си)”

  1. Very nice article and right to the point. I am not sure if this is truly the best place to
    ask but do you folks have any thoughts on where to get some professional
    writers? Thanks in advance 🙂

  2. Really wonderful info can be found on web site..

Leave a Comment