Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int valeur, valeurCible, compteur;
- cin >> valeurCible;
- for (int compteur = 0 ; compteur <= valeurCible ; compteur ++)
- {
- valeur = 0;
- for(int nombre = 1; nombre <= compteur; nombre ++)
- if (compteur%nombre == 0)
- valeur++;
- if (valeur == 2)
- cout << compteur << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement