Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <iomanip>
- using namespace std;
- int main() {
- int x;
- bool f=true;
- cin >> x;
- for (int i = x-1; i > 1; i--) {
- if (x % i == 0){
- f = false;
- }
- }
- if (f == true){
- cout <<"Broj je prost"<< endl;
- }
- else {
- cout << "Broj nije prost"<< endl;
- }
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement