Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - The method isprime(int a) written in java language is used to judge whether an integer a is a prime number. If it is a prime number, the method returns 1, otherwise it returns 0.
The method isprime(int a) written in java language is used to judge whether an integer a is a prime number. If it is a prime number, the method returns 1, otherwise it returns 0.
int? isPrime(int? a)? {

If (a<2)

Return? 0;

for(int? I = 2; ? I & lta;; ? i++)? {

If (a%2==0)

Break;

}

If (i & gt=a)

Return? 1;

Return? 0;

}