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 pkg40313;
- import java.util.*;
- /**
- *
- * @author L1PC08
- */
- public class Main {
- /**
- * @param args the command line arguments
- */
- public static void main(String[] args) {
- int x,i,ok=1;
- Scanner ts=new Scanner(System.in);
- System.out.println("dati doua nr de la tastatura");
- x=ts.nextInt();
- for(i=2;i<x/2;i++)
- if(x%i==0)ok=0;
- if(ok==0)
- System.out.println(x+" nu este prim");
- else
- System.out.println(x+"este prim");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment