Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int f(int t[], int rozmiar)
- {
- int n, i, tmp=0;
- printf ("Podaj liczbe, ktorej szukasz:\n");
- scanf ("%d" ,&n);
- for (i=0; i<rozmiar; i++)
- {
- if (t[i]==n)
- {
- tmp=1;
- break;
- }
- }
- return tmp;
- }
- int main(void)
- {
- int tab[1000];
- int ilosc;
- int i;
- printf("Podaj ilosc liczb: ");
- scanf("%d", &ilosc);
- printf ("Podaj te liczby:");
- for(i=0; i<=ilosc-1; i++)
- scanf("%d", &tab[i]);
- printf("%d",f(tab, ilosc));
- getchar();
- getchar ();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment