Facebook
From Adrian Pietrzak, 5 Years ago, written in Java.
Embed
Download Paste or View Raw
Hits: 199
  1. package com.company;
  2. import java.util.Scanner;
  3.  
  4. public class Dialog {
  5.     static void inputValue() {
  6.         System.out.print("Wprowadź liczbę: ");
  7.     }
  8. }
  9.  
  10. public class Main
  11. {
  12.     public static void main(String[] args)
  13.     {
  14.         int value;
  15.         Scanner scanner = new Scanner(System.in);
  16.         Dialog.inputValue();
  17.  
  18.         value = scanner.nextInt();
  19.         for(int i=1;i<=value;i++)
  20.         {
  21.             if(value%i==0)
  22.             {
  23.                 System.out.println(i);
  24.             }
  25.         }
  26.     }
  27. }