Advertisement
Guest User

Untitled

a guest
Oct 24th, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. // AZ-zadanie.cpp : Defines the entry point for the console application.
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include <iostream>
  6. #include <string>
  7. #include <cstdlib>
  8. using namespace std;
  9. int main()
  10. {
  11. int rozmiar, zmienna;
  12. cout << "Podaj rozmiar tabliczy: ";
  13. cin >> rozmiar;
  14. int *tab = new int[rozmiar];
  15. for (int i = 0;i < rozmiar;i++)
  16. {
  17. cout << "Podaj " << i + 1 << " zmienna: ";
  18. cin >> tab[i];
  19. }
  20. cout << "Podaj jaka zmienna mamy szukac";
  21. cin >> zmienna;
  22. for (int i = 0;i < rozmiar;i++)
  23. {
  24. if (tab[i] == zmienna)
  25. {
  26. cout << "wystepuje";
  27. break;
  28. }
  29. }
  30. return 0;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement