Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main(){
- int x;
- cin >> x;
- if(x % 2 == 1) {
- int deliteli = 0;
- for(int i = 1; i <= x; i++) {
- if(x % i == 0) { // ako ostatokot pri delenje na x so i ni e ednakov na 0, toa znaci deka brojot i e delitel na x
- deliteli++;
- }
- }
- if(deliteli == 2) {
- cout << "brojot e prost" << endl;
- }
- else {
- cout << x << endl;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement