Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
882 B
1
Indexable
Never
#include <iostream>
#include <windows.h>
using namespace std;
int main()
{
    int mas[5];
    int mas2[5];
    int sum = 0;
    int max = INT32_MIN;
    int min = INT32_MAX;
    int h = 0;
    bool w = 0;
    int a;
    cin >> a;
    int an = 0;
    for (int i = 0; i < 5; i++)
    {
        mas2[i] == mas[i];
        cin >> mas[i];
        sum += mas[i];
        if (mas[i] > max && w == 0){
            max = mas[i];
            w = 1;
        }
        if (mas[i] == max && w == 1){
            h++;
        }
        if (mas[i] > max && w == 1)
        {
            h = 0;
            w = 0;
        }
        if (mas[i] < min)
        {
            min = mas[i];
        }
        if (a == mas[i])
        {
            an++;
        }
    }
    cout << sum << "\n" << max << "\n" << min << "\n" << h << "\n" << an;
    return 0;
}
Leave a Comment