Advertisement
veto14

VETORBUCETAO.JAVA

Sep 6th, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. package aa;
  2.  
  3. public class vetor {
  4. public static void main (String []args) {
  5. int[] chicobento = {3,4,5,6,7,8};
  6. int len = (chicobento.length - 1);
  7. int imprimeporra = len + 1;
  8. int meio = len/2;
  9. for (int i = 0; i < meio; i++) {
  10. int aux;
  11. aux = chicobento[len];
  12. chicobento[len] = chicobento[i];
  13. chicobento[i] = aux;
  14. len--;
  15. }
  16. for(int i=0; i<imprimeporra; i++) {
  17. System.out.print(chicobento[i] + " ");
  18. }
  19. }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement