SHARE
TWEET

Untitled

a guest Jul 16th, 2019 51 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2.  
  3. void deslocamento_esquerda (int array[], int i)
  4. {
  5.     int aux;
  6.     if (array [i] > array [i + 1])
  7.     {
  8.         aux = array [i];
  9.         array [i] = array [i + 1];
  10.         array [i + 1] = aux;
  11.     }
  12. }
  13.  
  14. void ler_array (int array[], int i)
  15. {
  16.     if (i < n)
  17.     {
  18.         scanf("%d", &array[i]);
  19.         ler_array(array, i + 1);
  20.     }
  21. }
  22.  
  23. int main()
  24. {
  25.     int n, i;
  26.     scanf("%d", &n);
  27.  
  28.     int array [n];
  29.     ler_array (array, 0);
  30.  
  31.     ordem_inversa (array, 0);
  32.     printf("%d", array);
  33.  
  34.     deslocamento_esquerda (array, 0);
  35.     printf("%d", array);
  36.  
  37.     ordem_decrescente (array, 0);
  38.     printf("%d", array);
  39.  
  40.     return 0;
  41. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top