Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- unsigned int prost (unsigned int k)
- {
- unsigned int count, i, j, c,l;
- count = 0;
- for (i=2; i<=k;i++)
- {
- for (j=2; j<i;j++)
- {
- if ((i%j) == 0) break;
- }
- if (j >= i)
- {
- for (c = 2; c <= k; c++)
- {
- for (l = 2; l < i; l++)
- {
- if ((c%l) == 0) break;
- }
- if (l >= c && (j*l) < k) count++;
- }
- }
- }
- return(count);
- }
- int main(void)
- {
- unsigned int n, res;
- scanf_s("%d", &n);
- res = prost (n);
- printf("%d", res);
- return(0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement