Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- struct hello
- {
- int len ;
- int wid;
- };
- int main() {
- hello st[6000];
- int n,a,b,i=0;
- cin>>n;
- int p=n;
- while(n--)
- {
- cin>>a>>b;
- if(a>b)
- {
- st[i].len=a;
- st[i].wid=b;
- }
- else
- {
- st[i].len=b;
- st[i].wid=a;
- }
- i++;
- }
- for(int j=0;j<p;j++)
- {
- for(int k=0;k+1<p-j;k++)
- {
- if(st[j].len>st[j+1].len)
- {
- hello tmp=st[j];
- st[j]=st[j+1];
- st[j+1]=tmp;
- }
- }
- }
- for(int i=0;i<n;i++)
- {
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement