Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- #include <vector>
- using namespace std;
- bool isPrime(int n)
- {
- if (n <= 1)
- {
- return false;
- }
- for (int i = 2; i <= sqrt(n); i++)
- {
- if (n % i == 0)
- {
- return false;
- }
- }
- return true;
- }
- int main()
- {
- int count = 0;
- int count2 = 0;
- int even = 4;
- int pcount = 0;
- vector<int> primevector;
- vector<int> evenvector;
- while (pcount < 169)
- {
- if (isPrime(count2) == true)
- {
- primevector.push_back(count2);
- pcount = pcount + 1;
- }
- count2 = count2 + 1;
- }
- while (count < 1000)
- {
- evenvector.push_back(even);
- count = count + 1;
- even = even + 2;
- }
- /*
- while (pcount < 169)
- {
- if (isPrime(count2) == true)
- {
- cout << count2 << " pcount: " << pcount << endl;
- pcount = pcount + 1;
- }
- count2 = count2 + 1;
- }
- */
- /*
- while (count < 1000)
- {
- cout << even << " count: " << count << endl;
- count = count + 1;
- even = even + 2;
- }
- */
- /*
- ((evenvector[ucount] = primevector[i] +
- primevector[j])
- == true)
- cout << evenvector[ucount] << " = "
- << primevector[i] << " + "
- << primevector[j] << " count: " << ucount;
- */
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement