Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main () {
- int n,nr=0,i=2,eprim;
- cin>>n;
- while (nr!=2){
- eprim=1;
- n--;
- while (i<=n/2&&eprim==1)
- {
- if (n%i==0)
- eprim=0;
- i++;
- }
- if (eprim==1) {
- cout<<n<<" ";
- nr++;
- }
- i=2;}
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement