Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int N,M,mi;
- int status=0;
- do
- {
- cin>>N>>M;
- if(N<1 || M>100)
- {
- cout<<"Ktoras liczba nie spelnia wymagan, jeszcze raz "<<endl;
- }
- else
- {
- while(mi<1 || mi>100)
- {
- for(int i=0; i<M; i++)
- {
- cin>>mi;
- if(N %mi == 0)
- {
- status=1;
- }
- if(mi<1 || mi>100)
- {
- cout<<"Ktoras liczba nie spelnia wymagan, od nowa "<<endl;
- break;
- }
- }
- }
- }
- }
- while(N<1 || M>100);
- if (status==1) cout<<"TAK";
- if (status==0) cout<<"NIE";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement