#include <iostream>
using namespace std;
const int sz = 14;
int main()
{
int mass[sz];
int count = 0;
for (size_t i = 0; i < sz; i++)
cin >> mass[i];
if (mass[i] % 2 == 0) count++;
}
cout << count << endl;
return 0;
int element;
int tmp = -1;
cin >> element;
if (mass[i] == element) tmp = i;
cout << tmp;
//PascalABC.NET версия 3.2, сборка 1389
//Если программа не запускается, то обновите версию
uses System.Linq;
begin
writeln('III');
var a := ReadArrInteger('Документы', ReadInteger('n=')).ToList;
writeln;
while a.Any() do
write(a[0], ' ');
a.RemoveAt(0);
if not a.Any then break;
write(a.Last, ' ');
a.RemoveAt(a.Count - 1);
var n := 0;
if a.Count > 1 then n := a.Count div 2 - 1;
write(a[n], ' ');
a.RemoveAt(n);
end;
end.
Объяснение:
#include <iostream>
using namespace std;
const int sz = 14;
int main()
{
int mass[sz];
int count = 0;
for (size_t i = 0; i < sz; i++)
{
cin >> mass[i];
if (mass[i] % 2 == 0) count++;
}
cout << count << endl;
return 0;
}
#include <iostream>
using namespace std;
const int sz = 14;
int main()
{
int mass[sz];
int element;
int tmp = -1;
cin >> element;
for (size_t i = 0; i < sz; i++)
{
cin >> mass[i];
if (mass[i] == element) tmp = i;
}
cout << tmp;
return 0;
}
//PascalABC.NET версия 3.2, сборка 1389
//Если программа не запускается, то обновите версию
uses System.Linq;
begin
writeln('III');
var a := ReadArrInteger('Документы', ReadInteger('n=')).ToList;
writeln;
while a.Any() do
begin
write(a[0], ' ');
a.RemoveAt(0);
if not a.Any then break;
write(a.Last, ' ');
a.RemoveAt(a.Count - 1);
if not a.Any then break;
var n := 0;
if a.Count > 1 then n := a.Count div 2 - 1;
write(a[n], ' ');
a.RemoveAt(n);
end;
end.
Объяснение: