SHARE
TWEET

Untitled

a guest Apr 18th, 2019 78 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <cstdio>
  2. #include <cmath>
  3. void isPrime(int number)
  4. {
  5.     int k = 0;
  6.     for(int i=2; i<number; i++)
  7.     {
  8.        if(number%i==0 && number != i)
  9.          ++k;
  10.     }  
  11.        if (k == 0)
  12.          printf("число %d простое\n", number);
  13.        else
  14.          printf("число %d не является простым\n", number);
  15. }
  16. int main(void) {
  17.     int a, b;
  18.     scanf("%d%d", &a, &b);
  19.     for(a; a <= b; ++a) {
  20.         isPrime(a);
  21.     }
  22. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top