Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- void deslocamento_esquerda (int array[], int i)
- {
- int aux;
- if (array [i] > array [i + 1])
- {
- aux = array [i];
- array [i] = array [i + 1];
- array [i + 1] = aux;
- }
- }
- void ler_array (int array[], int i)
- {
- if (i < n)
- {
- scanf("%d", &array[i]);
- ler_array(array, i + 1);
- }
- }
- int main()
- {
- int n, i;
- scanf("%d", &n);
- int array [n];
- ler_array (array, 0);
- ordem_inversa (array, 0);
- printf("%d", array);
- deslocamento_esquerda (array, 0);
- printf("%d", array);
- ordem_decrescente (array, 0);
- printf("%d", array);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement