Advertisement
Guest User

32

a guest
Oct 15th, 2019
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.52 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class HelloWorld{
  4.  
  5.      public static void main(String []args){
  6.           Scanner in = new Scanner(System.in);
  7.          int n = in.nextInt();
  8.          int s = 0;
  9.          int k=0;
  10.          while (k!=1) {
  11.              k = 0;
  12.              int i=1;
  13.              n+=1;
  14.              while(i!=n-1){
  15.                 if (n%i==0){
  16.                     k+=1;
  17.                
  18.                 }
  19.                 i++;
  20.              }
  21.          }
  22.         System.out.println(n);
  23.          }
  24.      }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement