Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <time.h>
- #include <windows.h>
- int main()
- {
- srand(time(NULL));
- char f;
- int i,j;
- int A[75]={0};
- for (i=0; i<75; i++)
- {
- A[i]=(-5)+rand()%26;
- }
- int x,y;
- int max=-6;
- for (i=0; i<75; i++)
- for (j=0; j<75; j++)
- if (A[i]-A[j]>max)
- {
- x=i; y=j;
- max=A[i]-A[j];
- }
- printf("%d ",A[x]);
- printf("%d ",A[y]);
- printf(" left-right= %d",A[x]-A[y]);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment