Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<stdlib.h>
- int main()
- {
- int x,n,h,t=-1,r=0;
- printf("Please input a number:");
- scanf("%d",&x);
- for(n=3;n<x;n++)
- {
- for(h=2;h<n;h++)
- {
- if(n%h==0)
- break;
- }
- if(n==h)
- {
- if(n-t==2)
- {printf("(%d,%d)",t,n);
- r++;
- } t=n;
- }
- }
- printf("%dtimes",r);
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement