Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int tab[10000001];
- int main()
- {
- int a;
- cin>>a;
- tab[0]=0;
- tab[1]=0;
- for (int i=2; i<1000000; i++)
- {
- tab[i]=1;
- }
- for (int j=0; j<1000000; j++)
- if(tab[j]==1)
- for (int k=2*j; k<1000000; k=k+j)
- {
- tab[k]=0;
- }
- if (tab[a]==1)
- {
- cout<<"pierwsza";
- }
- else
- cout<<"zlozona";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement