Advertisement
Lustacho

Untitled

Oct 14th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.75 KB | None | 0 0
  1. #define _CRT_SECURE_NO_WARNINGS
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4. #include <locale.h>
  5. int main()
  6.     {
  7.         system("color f0");
  8.     setlocale(LC_ALL,"rus");
  9.     int N;
  10.     printf("Введите количество элементов:");
  11.     scanf("%d",&N);
  12.     int a[N];
  13.     int i,K,L;
  14.     printf("Введите минимальное число диапозона ",K);
  15.     scanf ("%d",&K);
  16.     printf("Введите максимальное число диапозона",L);
  17.     scanf ("%d",&L);
  18.   for (i = 0; i<N; i++)
  19.     {
  20.       printf("a[%d] = ", i);
  21.       scanf("%d", &a[i]);
  22.     }
  23.   for (i = 0; i<N; i++){
  24.         if(abs(a[i])>=K && abs(a[i])<=L )
  25.       {
  26.         printf("a[%d]= %d;",i,abs(a[i]));
  27.       }
  28.     }
  29.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement