#include <bits/stdc++.h>
using namespace std;
const int n=100;
int main()
{
int *A=(int*) malloc(n*sizeof(int));
srand(time(NULL));
for(int i=0; i<n; i++){
A[i]=rand()%50*10;
}
cout<<"Vetor aleatorio.";
for(int i=0; i<n; i++){
cout<< A[i]<<" ";
}
for(int i=0; i < (n-1); i++){
for(int j=0; j < (n-i-1); j++){
if(A[j] > A[j+1]){
int aux=A[j];
A[j]=A[j+1];
A[j+1]=aux;
}
}
}
cout<<"Vetor ordenado:\n";
for(int i=0; i<n; i++){
cout<<A[i]<<" ";
}
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7Cgpjb25zdCBpbnQgbj0xMDA7CgppbnQgbWFpbigpCnsKICAgIGludCAqQT0oaW50KikgbWFsbG9jKG4qc2l6ZW9mKGludCkpOwogICAgc3JhbmQodGltZShOVUxMKSk7CiAgICBmb3IoaW50IGk9MDsgaTxuOyBpKyspewogICAgICAgIEFbaV09cmFuZCgpJTUwKjEwOwogICAgfQoKICAgIGNvdXQ8PCJWZXRvciBhbGVhdG9yaW8uIjsKICAgIGZvcihpbnQgaT0wOyBpPG47IGkrKyl7CiAgICAgICAgY291dDw8IEFbaV08PCIgIjsKICAgIH0KCiAgICBmb3IoaW50IGk9MDsgaSA8IChuLTEpOyBpKyspewogICAgICAgIGZvcihpbnQgaj0wOyBqIDwgKG4taS0xKTsgaisrKXsKICAgICAgICAgICAgaWYoQVtqXSA+IEFbaisxXSl7CiAgICAgICAgICAgICAgICBpbnQgYXV4PUFbal07CiAgICAgICAgICAgICAgICBBW2pdPUFbaisxXTsKICAgICAgICAgICAgICAgIEFbaisxXT1hdXg7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICB9CgogICAgY291dDw8IlZldG9yIG9yZGVuYWRvOlxuIjsKICAgIGZvcihpbnQgaT0wOyBpPG47IGkrKyl7CiAgICAgICAgY291dDw8QVtpXTw8IiAiOwogICAgfQoKICAgIHJldHVybiAwOwp9Cg==