Advertisement
Guest User

Untitled

a guest
Feb 28th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int N,M,mi;
  8. int status=0;
  9.  
  10.  
  11.  
  12. do
  13. {
  14. cin>>N>>M;
  15. if(N<1 || M>100)
  16. {
  17. cout<<"Ktoras liczba nie spelnia wymagan, jeszcze raz "<<endl;
  18. }
  19. else
  20. {
  21. while(mi<1 || mi>100)
  22. {
  23.  
  24. for(int i=0; i<M; i++)
  25. {
  26.  
  27. cin>>mi;
  28.  
  29.  
  30. if(N %mi == 0)
  31. {
  32. status=1;
  33.  
  34. }
  35.  
  36.  
  37.  
  38. if(mi<1 || mi>100)
  39. {
  40. cout<<"Ktoras liczba nie spelnia wymagan, od nowa "<<endl;
  41. break;
  42. }
  43.  
  44. }
  45.  
  46.  
  47. }
  48.  
  49.  
  50.  
  51.  
  52. }
  53. }
  54. while(N<1 || M>100);
  55.  
  56. if (status==1) cout<<"TAK";
  57. if (status==0) cout<<"NIE";
  58.  
  59. return 0;
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement