Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- using std::cin;
- using std::cout;
- using std::endl;
- int main()
- {
- int num, i, thing = 1;
- cin >> num;
- if (num <= 2)
- cout << 0;
- else {
- for(i=2; i < sqrt(num); i++) {
- if(num%i==0)
- thing = 0;
- }
- }
- if (thing = 0)
- cout << 0;
- else
- cout << 1;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement