Zadatak58-16

#include <iostream>
using namespace std;
int main()
{int n,i,j;

cin >>n;
float a[n],b[n];
for( i=0;i<n;i++)
{

cin>>b[i]>>a[i];
}
for(i=0;i<n-1;i++)
for(j=i+1;j<n;j++)

if(a[j]<a[i])
{swap(a[i],a[j]);
swap(b[i],b[j]);
}
for(i=0;i<n;i++)
cout<<b[i]<<endl;
return 0;

Advertisements