Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package aa;
- public class vetor {
- public static void main (String []args) {
- int[] chicobento = {3,4,5,6,7,8};
- int len = (chicobento.length - 1);
- int imprimeporra = len + 1;
- int meio = len/2;
- for (int i = 0; i < meio; i++) {
- int aux;
- aux = chicobento[len];
- chicobento[len] = chicobento[i];
- chicobento[i] = aux;
- len--;
- }
- for(int i=0; i<imprimeporra; i++) {
- System.out.print(chicobento[i] + " ");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement