Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
100% Quality Score
Upvotes Received
1
Posts with Upvotes
1
Upvoting Members
1
Downvotes Received
0
Posts with Downvotes
0
Downvoting Members
0
0 Endorsements
~550 People Reached
Favorite Forums
Favorite Tags
c++ x 5
Member Avatar for Yogesh_9

#include<iostream> #include<stdlib.h> using namespace std; int readInt() { int cc=getc(stdin); for(;cc<'0'||cc>'9';) cc=getc(stdin); int ret=0; for(;cc>='0'&&cc<='9';) { ret=ret*10+cc-'0'; cc=getc(stdin); } return ret; } int main(void) { int p=readInt(); cout<<p<<endl; return 0; }

Member Avatar for mike_2000_17
0
179
Member Avatar for Yogesh_9

#include<iostream> using namespace std; int main() { int test; cin>>test; while(test--) { int start,end,m; cin>>start; cin>>end; bool arr[end]; for(int i=0;i<end;i++) arr[i]=true; for(int i=2;(i*i)<=end;i++) { for(int p=2;(p*i)<=end;p++) { m=(p*i-1); arr[m]=false; } } for(int i=start-1;i<=end;i++) { if(arr[i]!=0&&i!=0) cout<<i+1<<endl; } } return 0; }

Member Avatar for StuXYZ
1
371