|
- #include<iostream>
- using namespace std;
- int x,y,i,s;
- bool bx,by;
- int main()
- {
- s=0;for (x=2;x<=98;x++)
- {
- y=x+2;
- i=2;bx=1;
- while (i*i<=x && bx)
- if (x%i==0) bx=0;else i++;
- i=2;by=1;
- while (i*i<=y && by)
- if (y%i==0) by=0;else i++;
- if (bx && by) cout<<++s<<':'<<x<<' '<<y<<endl;
- }
- return 0;
- }
复制代码 |
|