Advertisement
Josif_tepe

Untitled

Oct 19th, 2024
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.28 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int dali_e_prost(int x) {
  5.     for(int i = 2; i < x; i++) {
  6.         if(x % i == 0) {
  7.             return 0;
  8.         }
  9.     }
  10.     return 1;
  11. }
  12. int main() {
  13.     int a = 29;
  14.     cout << dali_e_prost(a) << endl;
  15.    
  16.     return 0;
  17. }
  18.  
  19.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement