Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Program: sprimo.cc
- // Author: Yoan Pinzon
- // Date: Agosto 30, 2006
- #include <iostream>
- using namespace std;
- int main(){
- int n, c=0;
- cout << "Entre n: "; cin >> n;
- for(int i=1; i<n; i++){
- c=0;
- for(int j=2; j<=sqrt(i); j++) if( i%j==0 ) c++;
- if(!c) cout << (i<3?"[":"") << i << (i<3?"]":"") << "-";
- }
- cout << "\b " << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement