Advertisement
Guest User

Testat01

a guest
Oct 31st, 2014
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.38 KB | None | 0 0
  1. public class Testat01 {
  2.     public static int[] berechne(int[] array) {
  3.         if (array.length % 2 == 0) {
  4.             array[0] *= 3 ;
  5.             array[array.length-1] *= 3 ;
  6.         }
  7.         else {
  8.             return array ;
  9.         }
  10.         for (int i = 1 ; i < array.length - 1 ; i++) {
  11.                 array[i] *= 2 ;
  12.             }
  13.         return array ;
  14.     }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement