Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <iostream>
- #include <stdlib.h>
- #include <math.h>
- using namespace std;
- bool isprime(int long num){
- if(num<=1)return false;
- if(num==2)return true;
- if(num%2==0)return false;
- for(int long i=3;i<sqrt(num);i+=2){
- if(num%i==0)return false;
- }
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement