Advertisement
Guest User

Untitled

a guest
Oct 16th, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.57 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <math.h>
  3. // Shpilevaya Ksenia 4 lab: 25
  4. int main()
  5. {
  6.     int n;
  7.     scanf("%d", &n);
  8.     int mas[n];
  9.     int j, number;
  10.     int prnum = 1;
  11.     int max = 0;
  12.     for(j = 1; j <= n; j++)
  13.     {
  14.         scanf("%d", &mas[j]);
  15.         if (abs(mas[j]) <= 10)
  16.         {
  17.             prnum = prnum * mas[j];
  18.             if (mas[j] > max)
  19.             {
  20.                 max = mas[j];
  21.                 number = j;
  22.             }
  23.         }
  24.     }
  25.     if (prnum == 1) printf("No");
  26.     else printf("%d %d %d", prnum, max, number);
  27.  
  28.     return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement