Advertisement
patryk178

Untitled

Jan 22nd, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 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]!=2)return true;
  10. }
  11. return false;
  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<<"Znajduje sie";
  26. else cout<<"Nie znajduje sie";
  27. return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement