wap according to below givings.
The online math course provider MathAtTip'
has designed a course for children called
Learning Number Recognition and Counting,
The assessment part of the course has a
question where the student is given a number
and a digit. The student needz to find out the
total count of the digits present in the number
excluding the given digit.
int main()
Warning
Write an algorithm to help the student find out
the count of the total number of digits present
in the number excluding the given digit.
#include<s
int main
20 - 1
Input
The input consists of two space separated
integers - number and digit where the first
integer represents the number and the second
integer represents the digit given to the
student.
Output
Print an integer representing the count
of the
total number of digits present in the number
excluding the given digit.
Constraints
0 < numbers 10
0 <digit s 9
Example
Input
5644456 5.
Output
Explanation
Excluding 5; the digits in the number are 4 and
6 and their total count is 5. Hence the output is
5.
Answers
Answer:
chicuijdchickekçí
Explanation:
hdpupduxoyc
Answer:
#include <bits/stdc++.h>
#define mod 1000000007
using namespace std;
long long digitNumber(long long n) {
if (n == 0)
return 1;
if (n == 1)
return 9;
if (n % 2) {
long long temp = digitNumber((n - 1) / 2) % mod;
return (9*(temp * temp)% mod)% mod;
} else {
long long temp = digitNumber(n / 2) % mod;
return (temp * temp) % mod;
}
}
int countExcluding(int n, int d)
{
if (d == 0)
return (9*digitNumber(n - 1))% mod;
else
return (8 * digitNumber(n - 1)) % mod;
}
int main() {
long long d = 9;
int n = 3;
cout << countExcluding(n, d) << endl;
return 0;
}
Explanation:
In this code,
I have considered all 3 digit numbers.
Here, the number taken as input is 9,
while this code is executing, this code will count all 3 digit numbers which do not include 9.
SPJ3