Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- #include <climits>
- #include <algorithm>
- using namespace std;
- int main ()
- {
- int n,max;
- max=INT_MIN;
- cout<<"n=";cin>>n;
- int a[n];
- for (int i=0;i<n;i++)
- {
- cin>>a[i];
- if (abs(a[i])>=max)
- max=abs(a[i]);
- }
- cout<<max<<endl;//выводит модуль максимального элемента
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement