Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<cstdlib>
- #include<cstdio>
- using namespace std;
- bool funkcja(double tab[], int rozmiar, double liczba){
- for(int i=0;i<rozmiar;i++){
- if(tab[i]==liczba){
- if(i%2==0){
- return true;
- }
- }
- }
- return false;
- }
- int main(){
- double tab[]={4,2,8,90,4,5,7,70,23};
- int rozmiar = sizeof tab / sizeof *tab;
- double liczba=2;
- cout<<": "<<funkcja(tab,rozmiar,liczba)<<endl;
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement