Advertisement
Alex_Zuev

Untitled

Feb 26th, 2015
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.86 KB | None | 0 0
  1. package com.company;
  2. import java.util.Arrays;
  3.  
  4. /**
  5.  * Created by Alex on 26.02.2015.
  6.  */
  7. public class Massive {
  8. public static boolean Check(int a) {
  9.     if (a%2==0 ){
  10.         return true;
  11.     }
  12.      else return false;
  13. }
  14.  
  15.  
  16.     public static void main(String[] args) {
  17.         int mSize=0;
  18.         for (int i=1; i<=99;i++){
  19.             if (Check(i)==false){
  20.                 mSize=mSize+1;
  21.             }
  22.         }
  23.        int m[];
  24.         int Cout = 0;
  25.         m=new int[mSize];
  26.         for (int i=1; i<=99;i++){
  27.             if (Check(i)==false){
  28.                 m[Cout]=i;
  29.                 Cout++;
  30.             }
  31.         }
  32.         for (int i=0;i<m.length;i++) {
  33.             System.out.print(m[i]+" ");
  34.         }
  35.         System.out.println();
  36.         for (int i=m.length-1;i>=0;i--) {
  37.             System.out.print(m[i]+" ");
  38.         }
  39.     }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement