Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int f(int n, int a[100])
- {
- int min=0, max=0;
- for(int i=0; i<n; i++)
- if(a[i]>max)
- max=a[i];
- min=max;
- for(int i=0; i<n; i++)
- if(a[i]<min)
- min=a[i];
- if((max-min)>1000)
- return 1;
- else
- return 0;
- }
- int main()
- {
- int a[10]={534, 545, 324, 533, 100, 64};
- int n=6;
- cout<<f(n, a);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement