@v.a.l.i.d
415 / 380 / 10
Регистрация: 21.09.2012
Сообщений: 913
|
17.12.2012, 18:33
|
|
C++ | 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
| #include <iostream>
#include <cmath>
using namespace std;
int main()
{
setlocale(LC_ALL, "Russian");
const int n = 10;
int a[n];
int max=INT_MIN, kol=0;
cout << "Введите " << n << " чисел:" << endl;
for (int i=0; i<n; i++)
cin >> a[i];
for (int i=0; i<n; i++)
if (a[i]%2!=0 && a[i]>max)
max = a[i];
for (int i=0; i<n; i++)
if (a[i]%2==0)
kol++;
cout << "Наибольшее из нечетных " << max << endl;
cout << "Количество четных " << kol << endl;
system("pause");
return 0;
} |
|
1
|