Advertisement
Guest User

ef

a guest
Feb 6th, 2016
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.52 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <cstdlib>
  3. #include <string.h>
  4. #include <math.h>
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9.   int tab[]={1,4,3,8,2,9,9,1,2,3,9,0,8,0,-1};
  10. int x=sizeof (tab);
  11. int l=0;
  12. int a;
  13. cout<<"wpisz swoja liczbe : "<<endl;
  14. cin>> a;
  15.       for (int i=0;i<=x;i++)
  16.     {
  17.     if (tab[i]==a)
  18.     l++;
  19.     }
  20.  
  21.     //if (l>=1)
  22.       // {
  23.         cout<<"w tablicy jest ta liczba"<<endl;
  24.         cout<<"twoja liczba wystepuje"<< l <<"razy"<<endl;
  25.        // ;}
  26.  
  27.     system("PAUSE");
  28.     return EXIT_SUCCESS;
  29.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement