Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ///Model BAC 2016 Sub III Ex 3
- #include <iostream>
- using namespace std;
- int main()
- { int n,c,r=0,k=0;
- cin>>n;
- if(n==0){
- k=1;
- cout<<k;
- }
- else{
- while(n!=0){
- c=n%10;
- n=n/10;
- if(c==r){
- k++;///potrivire cifra rang
- }
- r++;
- }
- cout<<k;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement