#include <stdlib.h>
#include <time.h>
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
setlocale(LC_ALL, "Ukr");
srand(time(0));
int n;
int count;
cout << " Input n";
cin >> n;
int array[n];
for(int i=0;i<n;i++)
{
array[i]=rand()%30;
cout << setw(5) << array[i];
}
cout << endl;
for(int i=0;i<n;i++)
{
if(array[i] % 2 == 0)
{
count++;
cout << setw(5) << array[i];
//cout << " 4etnoe "<< count;
}
}
cout << " Colvo 4etnoe "<< count << endl;
return 0;
}
Var
N,A:integer;
Begin
Write('N = ');Read(N);
A:=0;
While N>0 do
Begin
if (N mod 10) > A then A:= N mod 10;
N:=N div 10;
End;
Write(A)
End.
Var
N,A,B:integer;
C:boolean;
Begin
Write('N = ');Read(N);
A:=-1;
B:=-2;
C:=false;
While N>0 do
Begin
if A=B then C:=true;
if N>0 then
Begin
A:=N mod 10;
N:=N div 10;
End;
if A=B then C:=true;
if N>0 then
Begin
B:=N mod 10;
N:=N div 10;
End;
End;
if A=B then C:=true;
if C then Write('Есть')
else Write('Нет')
End.
Подробнее - на -