Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <cstdlib>
- #include <string.h>
- #include <math.h>
- using namespace std;
- int main()
- {
- int tab[]={1,4,3,8,2,9,9,1,2,3,9,0,8,0,-1};
- int x=sizeof (tab);
- int l=0;
- int a;
- cout<<"wpisz swoja liczbe : "<<endl;
- cin>> a;
- for (int i=0;i<=x;i++)
- {
- if (tab[i]==a)
- l++;
- }
- //if (l>=1)
- // {
- cout<<"w tablicy jest ta liczba"<<endl;
- cout<<"twoja liczba wystepuje"<< l <<"razy"<<endl;
- // ;}
- system("PAUSE");
- return EXIT_SUCCESS;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement