Respuesta :
Answer:
Using C++, the program appears as follows
#include <iostream>
using namespace std;
int main() {
int r,g,b,small;
//input values
cin>>r>>g>>b;
//find the smallest value
if(r<g && r<b)
small=r;
else if(g<b)
small=g;
else
small=b;
//subtract smallest of the three values from rgb values hence removing gray
r=r-small;
g=g-small;
b=b-small;
cout<<r<<" "<<g<<" "<<b<<endl;
}
Answer:
Using C++, the program is as follows;
#include <iostream>
using namespace std;
int main() {
int r,g,b,small;
//input values
cin>>r>>g>>b;
//find the smallest value
if(r<g && r<b)
small=r;
else if(g<b)
small=g;
else
small=b;
//subtract smallest of the three values from rgb values hence removing gray
r=r-small;
g=g-small;
b=b-small;
cout<<r<<" "<<g<<" "<<b<<endl;
}