#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <time.h>
#include <locale.h>
//Função do Bubble Sort
void bubbleSort( char ( * V) [ 30 ] , int Fim)
{
int i, j;
char temp[ 30 ] ;
for ( i= 0 ; i< Fim; i++ )
{
for ( j= 0 ; j< Fim - 1 - i; j++ )
{
{
}
}
}
}
//Código
int main( )
{
int Fim= 0 , i= 0 ;
printf ( "\n Quantas pessoas deseja cadastrar? " ) ; char V[ Fim] [ 30 ] ;
for ( i= 0 ; i< Fim; i++ )
{
printf ( "\n ---------------------------------------" ) ; printf ( "\n Digite o nome da %iº pessoa: " , i
+ 1 ) ; }
printf ( "\n ############### ORDENAÇÃO POR NOME ###############" ) ; for ( i= 0 ; i< Fim; i++ )
{
bubbleSort( V, Fim) ;
}
return 0 ;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdGRsaWIuaD4KI2luY2x1ZGUgPHN0cmluZy5oPgojaW5jbHVkZSA8bWF0aC5oPgojaW5jbHVkZSA8dGltZS5oPgojaW5jbHVkZSA8bG9jYWxlLmg+CgovL0Z1bsOnw6NvIGRvIEJ1YmJsZSBTb3J0CnZvaWQgYnViYmxlU29ydChjaGFyICgqVilbMzBdLCBpbnQgRmltKQp7CiAgICBpbnQgaSwgajsKICAgIGNoYXIgdGVtcFszMF07CgogICAgZm9yKGk9MDsgaTxGaW07IGkrKykKICAgIHsKICAgICAgICBmb3Ioaj0wOyBqPEZpbSAtIDEgLSBpOyBqKyspCiAgICAgICAgewogICAgICAgICAgICBpZihzdHJjbXAoVltqXSwgVltqKzFdKSA+IDApCiAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgIHN0cmNweSh0ZW1wLCBWW2pdKTsKICAgICAgICAgICAgICAgIHN0cmNweShWW2pdLCBWW2orMV0pOwogICAgICAgICAgICAgICAgc3RyY3B5KFZbaisxXSwgdGVtcCk7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICB9Cn0KCi8vQ8OzZGlnbwppbnQgbWFpbigpCnsKICAgIHNldGxvY2FsZShMQ19BTEwsICJQT1JUVUdVRVNFIik7CiAgICBpbnQgRmltPTAsIGk9MDsKCiAgICBwcmludGYoIlxuIFF1YW50YXMgcGVzc29hcyBkZXNlamEgY2FkYXN0cmFyPyAiKTsKICAgIHNjYW5mKCIlaSIsICZGaW0pOwogICAgY2hhciBWW0ZpbV1bMzBdOwoKICAgIGZvcihpPTA7IGk8RmltOyBpKyspCiAgICB7CiAgICAgICAgcHJpbnRmKCJcbiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0iKTsKICAgICAgICBwcmludGYoIlxuICAgRGlnaXRlIG8gbm9tZSBkYSAlacK6IHBlc3NvYTogIiwgaSsxKTsKICAgICAgICBzY2FuZigiJXMiLCBWW2ldKTsKICAgIH0KICAgIHN5c3RlbSgiY2xzIik7CgoKICAgIHByaW50ZigiXG4gIyMjIyMjIyMjIyMjIyMjIE9SREVOQcOHw4NPIFBPUiBOT01FICMjIyMjIyMjIyMjIyMjIyIpOwogICAgZm9yKGk9MDsgaTxGaW07IGkrKykKICAgIHsKICAgICAgICBidWJibGVTb3J0KFYsIEZpbSk7CiAgICAgICAgcHJpbnRmKCJcbiAlcyIsIFZbaV0pOwogICAgfQoKICAgIHJldHVybiAwOwp9