Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package javaapplication8;
- import java.util.Scanner;
- /**
- *
- * @author thecl
- */
- public class IntArray {
- public static void main1(String[] args) {
- Scanner in = new Scanner(System.in);
- System.out.println("enter a quantity of nums");
- int len = (int) in.nextDouble();
- System.out.println("enter nums");
- double[] kek = new double[len];
- int j = 0;
- while(j<len){
- kek[j] = in.nextDouble();
- j++;
- }
- System.out.println();
- j = 0;
- do{
- System.out.print(kek[j] + " ");
- j++;
- }while(j<len);
- System.out.println();
- for(int i =0;i<len;i++){
- if(kek[i]==(int)kek[i]){
- System.out.print((int)kek[i] + " ");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement