import java.io.*;
/**
*
* @author subhani.s
*/
public class primeex {
public static void main(String args[])
{
new primeex();
}
int j;
public void myPrime(int k)
{
for (j=2; j
{
int l = k%j;
if(l==0)
{
if(j==k)
{
System.out.println("prime");
}
else
k--;
}
}
if(j==k)
{
System.out.println("prime number");
}
}
public primeex()
{
try
{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String str = br.readLine();
Integer x = Integer.valueOf(str);
myPrime(x);
int q;
q=x-j;
System.out.println("num: "+ q +"+"+ j);
}
catch(Exception e)
{
}
}
}
/**
*
* @author subhani.s
*/
public class primeex {
public static void main(String args[])
{
new primeex();
}
int j;
public void myPrime(int k)
{
for (j=2; j
int l = k%j;
if(l==0)
{
if(j==k)
{
System.out.println("prime");
}
else
k--;
}
}
if(j==k)
{
System.out.println("prime number");
}
}
public primeex()
{
try
{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String str = br.readLine();
Integer x = Integer.valueOf(str);
myPrime(x);
int q;
q=x-j;
System.out.println("num: "+ q +"+"+ j);
}
catch(Exception e)
{
}
}
}
No comments:
Post a Comment