Advertisement
patryk178

Untitled

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