Advertisement
Alex2002s

Untitled

Dec 11th, 2019
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3. #include <climits>
  4. #include <algorithm>
  5. using namespace std;
  6. int main ()
  7. {
  8. int n,max;
  9. max=INT_MIN;
  10. cout<<"n=";cin>>n;
  11. int a[n];
  12. for (int i=0;i<n;i++)
  13. {
  14. cin>>a[i];
  15. if (abs(a[i])>=max)
  16. max=abs(a[i]);
  17. }
  18. cout<<max<<endl;//выводит модуль максимального элемента
  19. return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement