Advertisement
patryk178

Untitled

Jan 22nd, 2019
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdlib>
  3. #include <time.h>
  4.  
  5.  
  6. using namespace std;
  7.  
  8. bool szukaj(int T[],int n)
  9. {
  10. for(int i=0;i<n;i++)
  11. {
  12. if(T[i]%4==0)return true;
  13. }
  14. return false;
  15. }
  16.  
  17. int main()
  18. {
  19. srand(time(NULL));
  20. int n=11;
  21.  
  22. int *T = new int[n];
  23.  
  24. for(int i=0;i<n;i++)
  25. {
  26. T[i] = rand()%33;
  27. cout<<T[i]<<endl;
  28. }
  29.  
  30. if(szukaj(T,n)==true)cout<<"Nie wszystkie";
  31. else cout<<"Wszystkie";
  32. return 0;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement