Advertisement
Jonas_3k

/*-Ordenação @ Desafio x Regras -*/

Apr 8th, 2013
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.66 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<time.h>
  3. #define Tx001 = 100
  4. #define Tx002 = 101
  5. int main()
  6. {
  7.    int condicao,conta,vetor[100];
  8.    srand(time(NULL));
  9.    for (condicao = 100; condicao > -1; condicao--)
  10.    {
  11.       vetor[condicao] = rand() % 37600;
  12.    }
  13.    condicao = 1;
  14.    while(condicao)
  15.    {
  16.       condicao = 0;
  17.       for( conta = 100; conta > -1 ; conta--)
  18.       {
  19.         if(vetor[Tx001 - conta] > vetor[Tx002 - conta])
  20.         {
  21.             vetor[Tx001 - conta] = vetor[Tx002 - conta] * vetor[Tx001 - conta];
  22.             vetor[Tx002 - conta] = vetor[Tx001 - conta] / vetor[Tx002 - conta];
  23.             vetor[Tx001 - conta] = vetor[Tx001 - conta] / vetor[Tx002 - conta];
  24.             condicao = 1;
  25.         }
  26.       }
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement