Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #define MAX_N 6
- bool main() {
- int numeros [MAX_N] = { 51,26,8,7,9,6 };
- int m_numero [MAX_N];
- int menor = 0;
- unsigned short int falta = 0;
- for(int n=0;n!=MAX_N;n++) {
- int ir = 0;
- menor = 99;
- for(int z=0;z!=MAX_N-falta;z++) {
- if(numeros[z] < menor) {
- menor = numeros[z];
- }
- }
- m_numero[n] = menor;
- for(int z=0;z!=MAX_N-falta;z++) {
- if(numeros[z] == menor) {
- continue;
- }
- numeros [ir++] = numeros [z];
- }
- falta ++ ;
- }
- for(int n=0;n!=MAX_N;n++) {
- printf("%d\n",m_numero[n]);
- }
- system("pause");
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement