subject

Summary: Given integer values for red, green, and blue, subtract the gray from each value. Computers represent color by combining the sub-colors red, green, and blue (rgb). Each sub-color's value can range from 0 to 255. Thus (255, 0, 0) is bright red, (130, 0, 130) is a medium purple, (0, 0, 0) is black, (255, 255, 255) is white, and (40, 40, 40) is a dark gray. (130, 50, 130) is a faded purple, due to the (50, 50, 50) gray part. (In other words, equal amounts of red, green, blue yield gray). Given values for red, green, and blue, remove the gray part. Ex: If the input is: 130 50 130 the output is: 80 0 80 Find the smallest value, and then subtract it from all three values, thus removing the gray. Note: This page converts rgb values into colors. the
#include
using namespace std;
int main() {
int red;
int green;
int blue;
cin >> red >> green >> blue;
if ((red <= green) && (red <= blue)) {
cout << red;
}
else if ((green <= red) && (green <= blue)) {
cout << green;
}
else {
cout << blue;
}
return 0;
}

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 00:20
The pyraminx is a rubik's cube-type toy in the shape of a tetrahedron (not a pyramid). the pyraminx shown below has edges 15\,\text{cm}15cm15, space, c, m long and vertical height h=12.2\,\text{cm}h=12.2cmh, equals, 12, point, 2, space, c, m. the triangle drawn with dashed lines is a right triangle. what is the distance rrr? round your answer to the nearest tenth.
Answers: 1
question
Computers and Technology, 22.06.2019 20:30
In this lab, you complete a prewritten c program that calculates an employee’s productivity bonus and prints the employee’s name and bonus. bonuses are calculated based on an employee’s productivity score as shown below. a productivity score is calculated by first dividing an employee’s transactions dollar value by the number of transactions and then dividing the result by the number of shifts worked.
Answers: 3
question
Computers and Technology, 23.06.2019 01:50
Write a program that uses a random number generator to generate a two digit positive integer and allows the user to perform one or more of the following operations: a. double the number. b. reverse the digits of the number. c. raise the number to the power of 2, 3, or 4. d. sum the digits of the number. e. if the number is a two-digit number, then raise the first digit to the power of the second digit. f. if the number is a three-digit number and the last digit is less than or equal to 4, then raise the first two digits to the power of the last digit. after performing an operation if the number is less than 10, add 10 to the number. also, after each operation determine if the number is prime. each successive operation should be performed on the number generated by the last operation. your program should not contain any global variables and each of these operations must be implemented by a separate function. also, your program should be menu driven. 7. (fraction calculator) write a program that
Answers: 1
question
Computers and Technology, 23.06.2019 08:00
Match the items with their respective descriptions.
Answers: 1
You know the right answer?
Summary: Given integer values for red, green, and blue, subtract the gray from each value. Computers...
Questions
question
Engineering, 05.05.2020 23:37
question
Mathematics, 05.05.2020 23:37
question
Mathematics, 05.05.2020 23:37
Questions on the website: 13722359