sandra0309

vezba20

Dec 14th, 2014
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.28 KB | None | 0 0
  1. #include<stdio.h>
  2. int main ()
  3. { int a,b,i,j,x
  4.  scanf("%d%d",&a,&b);
  5.  for (i=a;i<=b;i++)
  6.  {
  7.     int fleg=1;
  8.     x=i;
  9.     for (j=2;j<=x;j++)
  10.     {
  11.       if (x%j==0)
  12.       fleg=0;
  13.       break;
  14.     }
  15.     if (fleg==1)
  16.     {
  17.      printf("%d",x);
  18.     }
  19.     else
  20.     {
  21.     printf("X");
  22.     }
  23.  }
  24. return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment