Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class MetodoC {
- public static void main(String[]args){
- int v[]= {4,6,8,3,1,-1};
- metodoC(v);
- }
- public static boolean metodoC(int[]v){
- boolean val = true;
- int d = v.length/2;
- int x = v[0] + v[d];
- for (int i = 1; i < d && val; i++){
- int y = v[i] + v[d+i];
- if ( ( y != x ) || ( v[i] % 2 == 1 ) )
- val = false;
- }
- return val;
- }
- }
Add Comment
Please, Sign In to add comment