Guest User

Untitled

a guest
Jan 19th, 2012
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int f(int t[], int rozmiar)
  4. {
  5. int n, i, tmp=0;
  6. printf ("Podaj liczbe, ktorej szukasz:\n");
  7. scanf ("%d" ,&n);
  8. for (i=0; i<rozmiar; i++)
  9. {
  10. if (t[i]==n)
  11. {
  12. tmp=1;
  13. break;
  14. }
  15. }
  16. return tmp;
  17. }
  18.  
  19. int main(void)
  20. {
  21. int tab[1000];
  22. int ilosc;
  23. int i;
  24. printf("Podaj ilosc liczb: ");
  25. scanf("%d", &ilosc);
  26. printf ("Podaj te liczby:");
  27. for(i=0; i<=ilosc-1; i++)
  28. scanf("%d", &tab[i]);
  29. printf("%d",f(tab, ilosc));
  30. getchar();
  31. getchar ();
  32. return 0;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment