Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int WYSTAPIENIA(int n, int c)
- {
- int x=0, y;
- for(n; n>0; n=n/10)
- {
- y=n%10;
- if(y==c)
- {
- x++;
- }
- }
- return x;
- }
- int main()
- {
- cout << WYSTAPIENIA(1679236, 6) << endl;
- cout << WYSTAPIENIA(209009, 0) << endl;
- cout << WYSTAPIENIA(77776777, 7) << endl;
- return 0;
- }
Add Comment
Please, Sign In to add comment