include iostream include conio include stdio define LIM 100 using name

 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
31
32
33
34
35
#include <iostream>
#include <conio.h>
#include <stdio.h>
#define LIM 100
using namespace std;
void main(){
int a[LIM], check = 0;
int n, count = 0;
printf("Vivod pervogo elementa massiva a(n) udovletvoryaushego usloviu A(k) < A(n-1) \n");
do{
printf("\nVvedite 0<n<%d \n", LIM);
scanf ("%d", &n);
} while(n<=0 || n>LIM);
printf("\nVvedite elementi massiva\n");
for (int i=0; i<n; i++){
scanf("%d", &a[i]);
}
printf("\nIshodnii massiv\n");
for (int i=0; i<n; i++){
printf("%d ", a[i]);
}
printf("\n\nPervii element massiva a(n) udovletvoryaushego usloviu A(k) < A(n-1)\n");
for (int i=0; i<n; i++){
if (a[i] < a[n-1]){
printf("%d", a[i]);
check = 1;
break;
}
}
if (check == 0)
printf("%d\n\n", 0);
}