23
122. lcm(3, 4, 5, 6) = 60 Thus need the smallest number greater than or equal to 100 (the first 3-digit number) that is a multiple of 60 plus 2: 100 ÷ 60 = 1 r 40 → smallest multiple of 60 is 60 x 2 = 120 → required number is 120 + 2 = 122
If the number (count) of odd values to sum is odd, then the answer is odd.If the number (count) of odd values to sum is even, then the answer is even.
(a)(a-2)(a+2)(2a) It can be: 2044 3156 4268
Answer1 x 9 (number of 1 digit numbers) plus 2 x 89 (number of 2 digit numbers) plus 3(number of 3 digit numbers) x 347 = 1228 The correct answer is 1323. Here is how you do it.1 digit numbers = 92 digit numbers = 90 (99-9) number of 2 digit numbers - number of 1 digit numbers3 digit numbers = 378 (477-99) number of 3 digit numbers - number of 1 & 2 digit numbersSo, the solution is:1x9 = 92x90 = 1803x378 = 11349+180+378 = 1323
The first (left most) digit is the number of tens and the other is the number of ones. So 57 = 5 tens plus 7 ones = 50 + 7 = 57
The smallest two digit number is 00 (a number used as a wire gauge) and the biggest is 99, so the sum of the biggest and smallest 2-digits numbers is 99 (99 + 00).
Use the following function to count the number of digits in a string. size_t count_digits (const std::string& str) { size_t count = 0; for (std::string::const_iterator it=str.begin(); it!=str.end(); ++it) { const char& c = *it; if (c>='0' && c<='9'); ++count; } return count; }
122. lcm(3, 4, 5, 6) = 60 Thus need the smallest number greater than or equal to 100 (the first 3-digit number) that is a multiple of 60 plus 2: 100 ÷ 60 = 1 r 40 → smallest multiple of 60 is 60 x 2 = 120 → required number is 120 + 2 = 122
89
#include<iostream> #include<sstream> unsigned smallest_digit (double value) { unsigned long long integral = static_cast<unsigned long long>(value); while (value > integral) { value*=10; integral = static_cast<unsigned long long>(value); } unsigned smallest = integral % 10; while ((integral /= 10) != 0) { unsigned digit = integral % 10; if (digit < smallest) smallest = digit; } return smallest; } int main() { double d; while (true) { std::cout << "Enter a number: "; std::string s; std::getline (std::cin, s, '\n'); std::stringstream ss; ss << s; if (ss >> d) break; std::cerr << s << " is not a valid number.\n"; } std::cout << "The smallest digit in " << d << " is " << smallest_digit (d) << '\n'; }
n = 5.
89
try 91511, 9+5=14
727 ywwH
Technically, there is no such thing as "the smallest number" since we can go into negative numbers and they go on forever. But if we are talking about positive integers, then the smallest would be 1 1 plus zero equals one. The second smallest would be 2 2 plus 1 equals 3
The number 27 has a cube root of 3, which is 2 (the smallest prime) plus 1.
99324 (the third digit is 3)3+2=5