Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.company;
- import java.util.Arrays;
- /**
- * Created by Alex on 26.02.2015.
- */
- public class Massive {
- public static boolean Check(int a) {
- if (a%2==0 ){
- return true;
- }
- else return false;
- }
- public static void main(String[] args) {
- int mSize=0;
- for (int i=1; i<=99;i++){
- if (Check(i)==false){
- mSize=mSize+1;
- }
- }
- int m[];
- int Cout = 0;
- m=new int[mSize];
- for (int i=1; i<=99;i++){
- if (Check(i)==false){
- m[Cout]=i;
- Cout++;
- }
- }
- for (int i=0;i<m.length;i++) {
- System.out.print(m[i]+" ");
- }
- System.out.println();
- for (int i=m.length-1;i>=0;i--) {
- System.out.print(m[i]+" ");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement