Advertisement
evolse

Untitled

Jan 23rd, 2017
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1.  
  2. #include<iostream>
  3. #include<cstdlib>
  4. #include<cstdio>
  5. using namespace std;
  6.  
  7. bool funkcja(double tab[], int rozmiar, double liczba){
  8. for(int i=0;i<rozmiar;i++){
  9. if(tab[i]==liczba){
  10. if(i%2==0){
  11. return true;
  12. }
  13. }
  14. }
  15. return false;
  16.  
  17. }
  18.  
  19. int main(){
  20. double tab[]={4,2,8,90,4,5,7,70,23};
  21. int rozmiar = sizeof tab / sizeof *tab;
  22. double liczba=2;
  23. cout<<": "<<funkcja(tab,rozmiar,liczba)<<endl;
  24. system("pause");
  25. return 0;
  26.  
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement