Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int n, a[1000], i, maxx = -1e9, S = 0, minn = 1e9, imin, imax, intre, x;
- cin >> n;
- for( i = 1; i <= n; i++){
- cin >> a[i];
- if( a[i] > maxx){
- maxx = a[i];
- imax = i;
- }
- if( a[i] < minn){
- minn = a[i];
- imin = i;
- }
- }
- cout << imin << " " << imax;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement