8,764,320
9
To count the number of times a digit occurs in an integer, start by initializing an array of ten counts of digits, such as int digits[10];Then, in a loop while the number is non zero, increment the element in the digits array that corresponds to the units digit, and then divide the number by ten, such as digits[number%10]++ and number/=10;int digits[10];int i;int number = some number;for (i=0; i
1023456789
One idea would be to take the first 8 digits 0,1,2,3,4,5,6, and 7 and order them such that the biggest number is the first digit then the next biggest etc. This should do it, but then we would start with a 0 and that is really a 7 digit number. So let's just make the zero second. 10234567 Can you find a smaller one? If you don't use 0, then you have 1,2,3,4,5,6,7,8 and the number would be 12345678 but that is bigger. There is the issue of negative numbers which I have ignored on purpose! And, do we consider decimals like 1.0234567?
8,764,320
3201
9876543210
9
To count the number of times a digit occurs in an integer, start by initializing an array of ten counts of digits, such as int digits[10];Then, in a loop while the number is non zero, increment the element in the digits array that corresponds to the units digit, and then divide the number by ten, such as digits[number%10]++ and number/=10;int digits[10];int i;int number = some number;for (i=0; i
1023
1023456789
To make the greatest number using 1, 7, 0, and 6 only once, you will have a 4 digit number. From there you will want to start with the greatest digit.In this case 7 is the biggest digit. So we have 7??? and have 1, 0, and 6 left.Once again, use the biggest digit (6). We now have 76?? and have 1 and 0 left.One is greater than zero, so now we have 761?.The last number, 0, makes: 7610 which is your answer.The answer is 7610.
One idea would be to take the first 8 digits 0,1,2,3,4,5,6, and 7 and order them such that the biggest number is the first digit then the next biggest etc. This should do it, but then we would start with a 0 and that is really a 7 digit number. So let's just make the zero second. 10234567 Can you find a smaller one? If you don't use 0, then you have 1,2,3,4,5,6,7,8 and the number would be 12345678 but that is bigger. There is the issue of negative numbers which I have ignored on purpose! And, do we consider decimals like 1.0234567?
TWO digits are in the number 30, 3 and 0
There are two digits, 3 and 0, in the number 30.
9,876,543,210