Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <time.h>
- #include <windows.h>
- using namespace std;
- int main()
- {
- srand(time(NULL));
- bool f;
- int A[75]={0};
- for (int i=0; i<75; i++)
- {
- f=rand()%2;
- if (f)
- A[i]=rand()%21;
- else
- A[i]=(-1)*(rand()%6);
- }
- int x,y;
- int max=-6;
- for (int i=0; i<75; i++)
- for (int j=0; j<75; j++)
- if (A[i]-A[j]>max)
- {
- x=i; y=j;
- max=A[i]-A[j];
- }
- cout<<A[x]<<" "<<A[y]<<" left-right= "<<A[x]-A[y];
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment