Codigo fuente
#include <iostream>
using namespace std;
#include <iostream>
using namespace std;
int main(){
cout << "2 3 5 7 ";
for(int i=2;i<=1000;++i){
if((i%2) != 0 && (i%3)!=0 && (i%5)!=0 && (i%7)!=0)
cout << i << " ";
else if(i%50==0)
cout << endl;
}
return 0;
}
#include <iostream>
using namespace std;
#include <iostream>
using namespace std;
int main(){
cout << "2 3 5 7 ";
for(int i=2;i<=1000;++i){
if((i%2) != 0 && (i%3)!=0 && (i%5)!=0 && (i%7)!=0)
cout << i << " ";
else if(i%50==0)
cout << endl;
}
return 0;
}
No hay comentarios:
Publicar un comentario