Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 7 => 7
- 1000 => 819
- 3456 => 2562
- 10000 => 7380
- f(int n)
- {
- int i=1;
- int c=n;
- for(; i<=n; i++)
- {
- int m=-1;
- int x=i;
- while(x)
- {
- if (x % 10 == m)
- {
- c--;
- break;
- }
- m = x % 10;
- x /= 10;
- }
- }
- return c;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement