Untitled - CPP 0.52 KB
                                
                                    #include<iostream>
using namespace std;



int main()
{
	int n;
	bool test =true;

	cout<<"Podaj liczbÄ™: ";
	cin>>n;

    if(n<2){
		cout<<"to nie jest licza pierwsza";
		test = false;
    }

    for(int i=2;i*i<=n;i++)
		if(n%i==0){
            cout<<"to nie jest licza pierwsza"<<endl;
            test = false;
		}
    if(test != false)
        cout<<"to jest licza pierwsza";




	return 0;
}
                                
                            

Paste Hosted With By Wklejamy.pl