Advertisement
patryk178

Untitled

Jan 22nd, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.42 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. bool szukaj(int T[],int n)
  6. {
  7.     for(int i=0;i<n;i++)
  8.     {
  9.         if(T[i]>11)return false;
  10.     }
  11.     return true;
  12. }
  13.  
  14. int main()
  15. {
  16.     int n=15;
  17.     int *T = new int[n];
  18.  
  19.     for(int i=0;i<n;i++)
  20.     {
  21.         cout<<"Podaj "<<i+1<<" element: ";cin>>T[i];
  22.     }
  23.  
  24.     if(szukaj(T,n)==true)cout<<"Mniejsze od 11";
  25.     else cout<<"wieksze niz 11";
  26.     return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement