Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* librerie */
- #include <iostream>
- #include <string>
- #include <fstream>
- using namespace std;
- void nprimi();
- int main()
- {
- nprimi();
- }
- void nprimi() {
- fstream file("C:\\Users\\N2_4A\\Desktop\\lvl.txt", ios::out);
- bool primo = true;
- if (file.is_open())
- {
- for(int i = 10;i < 1000;i++) {
- for(int j = 11; j < 1000;j++) {
- if(i % j == 0)
- primo = false;
- }
- if(primo)
- file << i << endl;
- primo = true;
- }
- }
- file.close();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement