chillurbrain

Task3Lab5_1

Dec 9th, 2015
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.29 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. class Task3_5_1 {
  4.     public static void main(String[] args) {
  5.         Scanner sc = new Scanner(System.in);
  6.         int num = sc.nextInt();
  7.         int i = 2;
  8.         while (i <= num) {
  9.             if ((num % i) == 0) {
  10.                 System.out.print(i + " ");
  11.                 num /= i;
  12.             }
  13.             else i++;
  14.         }
  15.     }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment