Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<time.h>
- #define Tx001 = 100
- #define Tx002 = 101
- int main()
- {
- int condicao,conta,vetor[100];
- srand(time(NULL));
- for (condicao = 100; condicao > -1; condicao--)
- {
- vetor[condicao] = rand() % 37600;
- }
- condicao = 1;
- while(condicao)
- {
- condicao = 0;
- for( conta = 100; conta > -1 ; conta--)
- {
- if(vetor[Tx001 - conta] > vetor[Tx002 - conta])
- {
- vetor[Tx001 - conta] = vetor[Tx002 - conta] * vetor[Tx001 - conta];
- vetor[Tx002 - conta] = vetor[Tx001 - conta] / vetor[Tx002 - conta];
- vetor[Tx001 - conta] = vetor[Tx001 - conta] / vetor[Tx002 - conta];
- condicao = 1;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement