Advertisement
Guest User

Untitled

a guest
Nov 1st, 2014
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.50 KB | None | 0 0
  1. import java.util.*;
  2.  
  3. public class czterdziescitrzy {
  4.        
  5.  
  6.     public static void main(String[] args) {
  7.          Scanner sc = new Scanner(System.in);
  8.         System.out.println("Podaj ilość liczb pierwszych: ");
  9.         int n = sc.nextInt();
  10.         int liczbaP=1;
  11.        
  12.        
  13.         for (int i=0; i<=n; i++){
  14.         if (liczbaP % 1 == 0 &&  liczbaP % liczbaP == 0);
  15.            
  16.         {
  17.          
  18.             System.out.print(", " +liczbaP);}
  19.        
  20.            
  21.         }
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement