-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDPZKPP1.0.cpp
More file actions
39 lines (38 loc) · 1.1 KB
/
Copy pathDPZKPP1.0.cpp
File metadata and controls
39 lines (38 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include <iostream>
#include <math.h>
using namespace std;
int main(){
cout << "DPZK Prime Program" << endl ;
cout << "PLEASE INPUT AS INTRODUCTION" << endl << "FAILED TO DO SO MAY CAUSE INFINITE LOOP" << endl;
while(1){
unsigned long long int r1, r2,x=2;
//cin >> x;
cout << "Please input the range" << endl;
//cin >> r1 >> r2;
r1=2;r2=100000;
bool n=true;
int c=0;
for(unsigned long long int in=r1;in<=r2;in++){
for(unsigned long long int i=2;i<=in/x;i++){
//cout << "d:"<< i << " ";
if((in%i==0)||(in%x==0)){
n=false;
break;
}
}
if(n){
cout << in << " ";
c++;
}
// if(c%500==0&&n==true){
// x=sqrt(2*in)*0.5;
//cout << "d;" <<x << " " << in << " ";
// }
n=true;
}
cout << endl << "Count is ";
cout << c << endl;
c=0;
break;
}
}