Advertisement
Dimitru

Teste de mesa

Jun 19th, 2019
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. main(void)
  2.  
  3. {
  4.  
  5. int x[10]={11,2,3,45,5,6,31,18,9,10};
  6.  
  7. int aux, reserva, i, a=0;
  8.  
  9. reserva=x[0];
  10.  
  11. for(i=0; i<10; i++)
  12.  
  13. {
  14.  
  15. if (i == 9 )
  16.  
  17. {
  18.  
  19. x[a]= x[9];
  20.  
  21. }
  22.  
  23. else
  24.  
  25. {
  26.  
  27. aux= x[ i + 1];
  28.  
  29. x[ i + 1]=reserva;
  30.  
  31. reserva=aux;
  32.  
  33. }
  34.  
  35. }
  36.  
  37. system("pause");
  38.  
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement